summaryrefslogtreecommitdiff
path: root/ios
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-04-14 19:30:09 -0400
committerKonstantin Käfer <mail@kkaefer.com>2014-04-14 19:30:09 -0400
commit9bb88711b8933e711f99b0f1fa09371ac8149c99 (patch)
tree04d17eebfc4245c43ece35a59c7a47bf120c1260 /ios
parent2e86f2582f3724d9b7b93ae9f3a9ee267b78e4bd (diff)
downloadqtlocation-mapboxgl-9bb88711b8933e711f99b0f1fa09371ac8149c99.tar.gz
always start animations with a common start time
fixes #134
Diffstat (limited to 'ios')
-rw-r--r--ios/MBXViewController.mm23
1 files changed, 3 insertions, 20 deletions
diff --git a/ios/MBXViewController.mm b/ios/MBXViewController.mm
index e7e45d322d..2a0f64849a 100644
--- a/ios/MBXViewController.mm
+++ b/ios/MBXViewController.mm
@@ -21,7 +21,6 @@
@property (nonatomic) CGFloat quickZoomStart;
@property (nonatomic) BOOL debug;
@property (nonatomic) UIView *palette;
-@property (nonatomic) NSTimeInterval elapsed;
@end
@@ -183,8 +182,6 @@ MBXViewController *view = nullptr;
- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect
{
- self.elapsed = CACurrentMediaTime();
-
// Render the map
map->resize(rect.size.width, rect.size.height, view.contentScaleFactor, view.drawableWidth, view.drawableHeight);
@@ -220,7 +217,6 @@ MBXViewController *view = nullptr;
- (void)unrotate
{
- self.elapsed = CACurrentMediaTime();
map->resetNorth();
}
@@ -300,8 +296,6 @@ MBXViewController *view = nullptr;
- (void)handlePinchGesture:(UIPinchGestureRecognizer *)pinch
{
- self.elapsed = CACurrentMediaTime();
-
map->cancelAnimations();
if (pinch.state == UIGestureRecognizerStateBegan)
@@ -357,8 +351,6 @@ MBXViewController *view = nullptr;
- (void)handleRotateGesture:(UIRotationGestureRecognizer *)rotate
{
- self.elapsed = CACurrentMediaTime();
-
map->cancelAnimations();
if (rotate.state == UIGestureRecognizerStateBegan)
@@ -382,15 +374,11 @@ MBXViewController *view = nullptr;
- (void)handleSingleTapGesture:(UITapGestureRecognizer *)singleTap
{
- self.elapsed = CACurrentMediaTime();
-
[self togglePalette];
}
- (void)handleDoubleTapGesture:(UITapGestureRecognizer *)doubleTap
{
- self.elapsed = CACurrentMediaTime();
-
map->cancelAnimations();
if (doubleTap.state == UIGestureRecognizerStateEnded) {
@@ -403,8 +391,6 @@ MBXViewController *view = nullptr;
- (void)handleTwoFingerTapGesture:(UITapGestureRecognizer *)twoFingerTap
{
- self.elapsed = CACurrentMediaTime();
-
map->cancelAnimations();
if (twoFingerTap.state == UIGestureRecognizerStateEnded) {
@@ -417,8 +403,6 @@ MBXViewController *view = nullptr;
- (void)handleQuickZoomGesture:(UILongPressGestureRecognizer *)quickZoom
{
- self.elapsed = CACurrentMediaTime();
-
map->cancelAnimations();
if (quickZoom.state == UIGestureRecognizerStateBegan)
@@ -446,6 +430,8 @@ MBXViewController *view = nullptr;
return ([validSimultaneousGestures containsObject:[gestureRecognizer class]] && [validSimultaneousGestures containsObject:[otherGestureRecognizer class]]);
}
+@end
+
namespace llmr {
namespace platform {
@@ -465,10 +451,7 @@ namespace llmr {
}
double elapsed() {
- return view.elapsed;
+ return CACurrentMediaTime();
}
}
}
-
-@end
-