diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-19 17:09:03 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-23 12:59:27 -0700 |
commit | 9e1cbbeacb4007f9c7919185df0aae90fc8f7ad1 (patch) | |
tree | 4595cd833cf328cc5ff63b8bc3f0d0d1e2294671 | |
parent | 71c8f6aa10368084bc0a365b15f004d0629a8b67 (diff) | |
download | qtlocation-mapboxgl-9e1cbbeacb4007f9c7919185df0aae90fc8f7ad1.tar.gz |
[node] Pixel ratio may be floating point
-rw-r--r-- | platform/node/src/node_map.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/node/src/node_map.cpp b/platform/node/src/node_map.cpp index 7261b33740..4254cd2abe 100644 --- a/platform/node/src/node_map.cpp +++ b/platform/node/src/node_map.cpp @@ -638,7 +638,7 @@ void NodeMap::AddImage(const Nan::FunctionCallbackInfo<v8::Value>& info) { return Nan::ThrowTypeError("width parameter required"); } - if (!Nan::Get(optionObject, Nan::New("pixelRatio").ToLocalChecked()).ToLocalChecked()->IsUint32()) { + if (!Nan::Get(optionObject, Nan::New("pixelRatio").ToLocalChecked()).ToLocalChecked()->IsNumber()) { return Nan::ThrowTypeError("pixelRatio parameter required"); } @@ -649,7 +649,7 @@ void NodeMap::AddImage(const Nan::FunctionCallbackInfo<v8::Value>& info) { return Nan::ThrowTypeError("Max height and width is 1024"); } - uint32_t pixelRatio = Nan::Get(optionObject, Nan::New("pixelRatio").ToLocalChecked()).ToLocalChecked()->Uint32Value(); + float pixelRatio = Nan::Get(optionObject, Nan::New("pixelRatio").ToLocalChecked()).ToLocalChecked()->NumberValue(); auto imageBuffer = Nan::To<v8::Object>(info[1]).ToLocalChecked()->ToObject(); char * imageDataBuffer = node::Buffer::Data(imageBuffer); |