Authored by Thomas Rasch

o RMPath: Don't recalculate the layer position

@@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
29 #import "RMPixel.h" 29 #import "RMPixel.h"
30 #import "RMProjection.h" 30 #import "RMProjection.h"
31 #import "RMMapView.h" 31 #import "RMMapView.h"
  32 +#import "RMAnnotation.h"
32 33
33 @implementation RMPath 34 @implementation RMPath
34 35
@@ -96,7 +97,7 @@ @@ -96,7 +97,7 @@
96 { 97 {
97 if (ignorePathUpdates) return; 98 if (ignorePathUpdates) return;
98 99
99 - CGPoint myPosition = [mapView projectedPointToPixel:projectedLocation]; 100 + CGPoint myPosition = self.annotation.position;
100 101
101 float scale = [mapView metersPerPixel]; 102 float scale = [mapView metersPerPixel];
102 float scaledLineWidth; 103 float scaledLineWidth;
@@ -152,7 +153,7 @@ @@ -152,7 +153,7 @@
152 // RMLog(@"new bounds: %f %f %f %f", self.bounds.origin.x, self.bounds.origin.y, self.bounds.size.width, self.bounds.size.height); 153 // RMLog(@"new bounds: %f %f %f %f", self.bounds.origin.x, self.bounds.origin.y, self.bounds.size.width, self.bounds.size.height);
153 154
154 pathBoundingBox = CGRectMake(myPosition.x + self.bounds.origin.x, myPosition.y + self.bounds.origin.y, self.bounds.size.width, self.bounds.size.height); 155 pathBoundingBox = CGRectMake(myPosition.x + self.bounds.origin.x, myPosition.y + self.bounds.origin.y, self.bounds.size.width, self.bounds.size.height);
155 - self.anchorPoint = CGPointMake(-pixelBounds.origin.x / pixelBounds.size.width,-pixelBounds.origin.y / pixelBounds.size.height); 156 + self.anchorPoint = CGPointMake(-pixelBounds.origin.x / pixelBounds.size.width, -pixelBounds.origin.y / pixelBounds.size.height);
156 [self setNeedsDisplay]; 157 [self setNeedsDisplay];
157 } 158 }
158 159