From e56a8113e7427b9ebc09623b8b2d4b6607a5aa15 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Thu, 1 May 2014 12:20:39 -0700 Subject: [PATCH] fix animation duration casting errors --- ios/MBXViewController.mm | 4 ++-- src/map/map.cpp | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ios/MBXViewController.mm b/ios/MBXViewController.mm index 062a2bd22..4d995fc1e 100644 --- a/ios/MBXViewController.mm +++ b/ios/MBXViewController.mm @@ -373,7 +373,7 @@ MBXViewController *viewController = nullptr; if (doubleTap.state == UIGestureRecognizerStateEnded) { - map->scaleBy(2, [doubleTap locationInView:doubleTap.view].x, [doubleTap locationInView:doubleTap.view].y, 0.5); + map->scaleBy(2, [doubleTap locationInView:doubleTap.view].x, [doubleTap locationInView:doubleTap.view].y, 0.3); } } @@ -383,7 +383,7 @@ MBXViewController *viewController = nullptr; if (twoFingerTap.state == UIGestureRecognizerStateEnded) { - map->scaleBy(0.5, [twoFingerTap locationInView:twoFingerTap.view].x, [twoFingerTap locationInView:twoFingerTap.view].y, 0.5); + map->scaleBy(0.5, [twoFingerTap locationInView:twoFingerTap.view].x, [twoFingerTap locationInView:twoFingerTap.view].y, 0.3); } } diff --git a/src/map/map.cpp b/src/map/map.cpp index cd56073c1..ded52215c 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -191,12 +191,12 @@ void Map::cancelTransitions() { #pragma mark - Position void Map::moveBy(double dx, double dy, double duration) { - transform.moveBy(dx, dy, duration); + transform.moveBy(dx, dy, duration * 1_second); update(); } void Map::setLonLat(double lon, double lat, double duration) { - transform.setLonLat(lon, lat, duration); + transform.setLonLat(lon, lat, duration * 1_second); update(); } @@ -225,12 +225,12 @@ void Map::resetPosition() { #pragma mark - Scale void Map::scaleBy(double ds, double cx, double cy, double duration) { - transform.scaleBy(ds, cx, cy, duration); + transform.scaleBy(ds, cx, cy, duration * 1_second); update(); } void Map::setScale(double scale, double cx, double cy, double duration) { - transform.setScale(scale, cx, cy, duration); + transform.setScale(scale, cx, cy, duration * 1_second); update(); } @@ -239,7 +239,7 @@ double Map::getScale() const { } void Map::setZoom(double zoom, double duration) { - transform.setZoom(zoom, duration); + transform.setZoom(zoom, duration * 1_second); update(); } @@ -248,7 +248,7 @@ double Map::getZoom() const { } void Map::setLonLatZoom(double lon, double lat, double zoom, double duration) { - transform.setLonLatZoom(lon, lat, zoom, duration); + transform.setLonLatZoom(lon, lat, zoom, duration * 1_second); update(); } @@ -274,7 +274,7 @@ void Map::stopScaling() { #pragma mark - Rotation void Map::rotateBy(double sx, double sy, double ex, double ey, double duration) { - transform.rotateBy(sx, sy, ex, ey, duration); + transform.rotateBy(sx, sy, ex, ey, duration * 1_second); update(); }