diff options
author | Kirill Zhdanovich <kzhdanovich@gmail.com> | 2013-03-12 18:26:37 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:51:39 +0300 |
commit | 14666ef8302574f042ed583ffee1ba71441b3cfa (patch) | |
tree | 634958bcf0ebc0efaeb3c6ea47256ff40442dd3d /iphone | |
parent | 788a8e18b197dfc7f8a2f2a55383e0475f7768bb (diff) |
Revert "Merge pull request #1379 from Kirillcpp/111"
This reverts commit d4407afcbaace1c846f591ac0183057a7f189c51, reversing
changes made to 62bce40ee730ec35b76ba77b881552f413f0ae77.
Diffstat (limited to 'iphone')
-rw-r--r-- | iphone/Maps/Classes/MapViewController.mm | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index 2afd35afa2..ddce85c1b6 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -463,12 +463,7 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { - if ([otherGestureRecognizer isKindOfClass:[UIPinchGestureRecognizer class]] - || [otherGestureRecognizer isKindOfClass:[UIRotationGestureRecognizer class]]) - { - return YES; - } - return NO; + return YES; } -(void)addGestures @@ -593,27 +588,16 @@ { if (recognizer.state == UIGestureRecognizerStateChanged) { - if (startedScaling) - { - f.StopScale(ScaleEvent(p1.x, p1.y, p2.x, p2.y)); - CGPoint z = [self pointFromRecognizerWithScaleFactor:recognizer]; - f.StartDrag(DragEvent(z.x, z.y)); - startedScaling = NO; - lastRotateTime = 0; - } - else - { - [self handlePan:(UIPanGestureRecognizer *)recognizer]; - } + if (startedScaling) + { + f.StopScale(ScaleEvent(p1.x, p1.y, p2.x, p2.y)); + startedScaling = NO; + } } if (recognizer.state != UIGestureRecognizerStateEnded) { return; } - else if (!startedScaling) - { - [self handlePan:(UIPanGestureRecognizer *)recognizer]; - } } //Work of Scale Recognizer @@ -651,23 +635,14 @@ { if (recognizer.numberOfTouches >1 ) { - CGPoint t1 = [recognizer locationOfTouch:0 inView:self.view]; - CGPoint t2 = [recognizer locationOfTouch:1 inView:self.view]; - + p1 = [recognizer locationOfTouch:0 inView:self.view]; + p2 = [recognizer locationOfTouch:1 inView:self.view]; CGFloat const scaleFactor = self.view.contentScaleFactor; - t1.x *= scaleFactor; - t1.y *= scaleFactor; - t2.x *= scaleFactor; - t2.y *= scaleFactor; - //avoid jumping if user scales or rotates with one finger fixed - if (startedScaling && CFAbsoluteTimeGetCurrent() - lastRotateTime > 0.1) - { - GetFramework().StartScale(ScaleEvent(t1.x, t1.y, t2.x, t2.y)); - lastRotateTime = CFAbsoluteTimeGetCurrent(); - } - p1 = t1; - p2 = t2; + p1.x *= scaleFactor; + p1.y *= scaleFactor; + p2.x *= scaleFactor; + p2.y *= scaleFactor; } } |