From 62b56b799a7d4fcd1a8f151eed878054b862da5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Wed, 26 Oct 2016 15:22:31 -0700 Subject: [core] change std::array to mbgl::Size --- platform/node/src/node_map.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'platform/node') diff --git a/platform/node/src/node_map.cpp b/platform/node/src/node_map.cpp index 671bf3e0fd..e630275ec0 100644 --- a/platform/node/src/node_map.cpp +++ b/platform/node/src/node_map.cpp @@ -356,12 +356,11 @@ void NodeMap::Render(const Nan::FunctionCallbackInfo& info) { } void NodeMap::startRender(NodeMap::RenderOptions options) { - map->setSize(std::array{{ static_cast(options.width), - static_cast(options.height) }}); + map->setSize({ options.width, options.height }); - const std::array fbSize{{ static_cast(options.width * pixelRatio), - static_cast(options.height * pixelRatio) }}; - if (!view || view->getSize() != fbSize) { + const mbgl::Size fbSize{ static_cast(options.width * pixelRatio), + static_cast(options.height * pixelRatio) }; + if (!view || view->size != fbSize) { view.reset(); view = std::make_unique(backend.getContext(), fbSize); } @@ -430,7 +429,7 @@ void NodeMap::renderFinished() { cb->Call(1, argv); } else if (img.data) { v8::Local pixels = Nan::NewBuffer( - reinterpret_cast(img.data.get()), img.size(), + reinterpret_cast(img.data.get()), img.bytes(), // Retain the data until the buffer is deleted. [](char *, void * hint) { delete [] reinterpret_cast(hint); @@ -790,7 +789,7 @@ NodeMap::NodeMap(v8::Local options) }()), backend(sharedDisplay()), map(std::make_unique(backend, - std::array{{ 256, 256 }}, + mbgl::Size{ 256, 256 }, pixelRatio, *this, threadpool, -- cgit v1.2.1