summaryrefslogtreecommitdiff
path: root/ios/MBXViewController.mm
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-02-19 15:39:44 +0100
committerKonstantin Käfer <mail@kkaefer.com>2014-02-19 15:39:44 +0100
commit9710fbef994f96c3eeab66aab4d73c97c7270138 (patch)
tree52d19f28de7f3394635ac37999a702e795ae7eff /ios/MBXViewController.mm
parent2602774a9c0074a642f18f65dafdcbf7c2b7dadb (diff)
downloadqtlocation-mapboxgl-9710fbef994f96c3eeab66aab4d73c97c7270138.tar.gz
enable texture interpolation during rotating and scaling
Diffstat (limited to 'ios/MBXViewController.mm')
-rw-r--r--ios/MBXViewController.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/ios/MBXViewController.mm b/ios/MBXViewController.mm
index a687350af0..040c05803e 100644
--- a/ios/MBXViewController.mm
+++ b/ios/MBXViewController.mm
@@ -236,6 +236,7 @@ class MBXMapView
if (pinch.state == UIGestureRecognizerStateBegan)
{
+ mapView->map.startScaling();
self.scale = mapView->map.getScale();
}
else if (pinch.state == UIGestureRecognizerStateChanged)
@@ -258,6 +259,7 @@ class MBXMapView
}
else if (pinch.state == UIGestureRecognizerStateEnded)
{
+ mapView->map.stopScaling();
if (fabsf(pinch.velocity) < 20)
return;
@@ -270,6 +272,9 @@ class MBXMapView
mapView->map.scaleBy(new_scale / scale, [pinch locationInView:pinch.view].x, [pinch locationInView:pinch.view].y, duration);
}
+ else if (pinch.state == UIGestureRecognizerStateCancelled) {
+ mapView->map.stopScaling();
+ }
[self updateRender];
}
@@ -280,12 +285,17 @@ class MBXMapView
if (rotate.state == UIGestureRecognizerStateBegan)
{
+ mapView->map.startRotating();
self.angle = mapView->map.getAngle();
}
else if (rotate.state == UIGestureRecognizerStateChanged)
{
mapView->map.setAngle(self.angle + rotate.rotation, [rotate locationInView:rotate.view].x, [rotate locationInView:rotate.view].y);
}
+ else if (rotate.state == UIGestureRecognizerStateEnded || rotate.state == UIGestureRecognizerStateCancelled)
+ {
+ mapView->map.stopRotating();
+ }
[self updateRender];
}