summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-05-29 14:07:32 +0200
committerKonstantin Käfer <mail@kkaefer.com>2018-06-04 10:43:21 +0200
commitd66251234d7c0feb875b9490ca945ee9d43306c1 (patch)
tree3c661091edb98ac15a8711e93fde774a5e6e824a /platform
parentd232a7a6f30927cb7e9107c9357bc53e2b1ae0f9 (diff)
downloadqtlocation-mapboxgl-d66251234d7c0feb875b9490ca945ee9d43306c1.tar.gz
[core] don't use floating point versions of pow/log
GLIBC 2.27 added new versioned symbols of powf and logf, while the double versions of pow and log remained stable. Prefer the double version to avoid introducing a dependency on a newer version of GLIBC than strictly necessary. See https://lists.gnu.org/archive/html/info-gnu/2018-02/msg00000.html
Diffstat (limited to 'platform')
-rw-r--r--platform/glfw/glfw_view.cpp2
-rw-r--r--platform/qt/src/qmapboxgl.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp
index 362269b8e4..fcb470e114 100644
--- a/platform/glfw/glfw_view.cpp
+++ b/platform/glfw/glfw_view.cpp
@@ -442,7 +442,7 @@ void GLFWView::onScroll(GLFWwindow *window, double /*xOffset*/, double yOffset)
scale = 1.0 / scale;
}
- view->map->setZoom(view->map->getZoom() + std::log2(scale), mbgl::ScreenCoordinate { view->lastX, view->lastY });
+ view->map->setZoom(view->map->getZoom() + ::log2(scale), mbgl::ScreenCoordinate { view->lastX, view->lastY });
}
void GLFWView::onWindowResize(GLFWwindow *window, int width, int height) {
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index 8c3355dc09..58158c1822 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -703,7 +703,7 @@ double QMapboxGL::scale() const
void QMapboxGL::setScale(double scale_, const QPointF &center)
{
- d_ptr->mapObj->setZoom(mbgl::util::log2(scale_), mbgl::ScreenCoordinate { center.x(), center.y() });
+ d_ptr->mapObj->setZoom(::log2(scale_), mbgl::ScreenCoordinate { center.x(), center.y() });
}
/*!
@@ -1111,7 +1111,7 @@ void QMapboxGL::moveBy(const QPointF &offset)
can be used for implementing a pinch gesture.
*/
void QMapboxGL::scaleBy(double scale_, const QPointF &center) {
- d_ptr->mapObj->setZoom(d_ptr->mapObj->getZoom() + mbgl::util::log2(scale_), mbgl::ScreenCoordinate { center.x(), center.y() });
+ d_ptr->mapObj->setZoom(d_ptr->mapObj->getZoom() + ::log2(scale_), mbgl::ScreenCoordinate { center.x(), center.y() });
}
/*!