From c08ace4661cda7eb9043eddde1c3095c4f39dfe7 Mon Sep 17 00:00:00 2001 From: Ash Furrow Date: Tue, 17 Jun 2014 21:31:56 +0200 Subject: [PATCH] Fixed #37. --- NAMapKit/NAMapView.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/NAMapKit/NAMapView.m b/NAMapKit/NAMapView.m index a31feed..e071a47 100644 --- a/NAMapKit/NAMapView.m +++ b/NAMapKit/NAMapView.m @@ -121,8 +121,12 @@ - (void)centerOnPoint:(CGPoint)point animated:(BOOL)animate - (CGPoint)zoomRelativePoint:(CGPoint)point { - CGFloat x = (self.contentSize.width / self.originalSize.width) * point.x; - CGFloat y = (self.contentSize.height / self.originalSize.height) * point.y; + CGFloat x = point.x; + CGFloat y = point.y; + if (fabsf(x) > 0 && fabsf(x) > 0) { + x = (self.contentSize.width / self.originalSize.width) * point.x; + y = (self.contentSize.height / self.originalSize.height) * point.y; + } return CGPointMake(round(x), round(y)); }