Authored by Vladimir Vyskocil

Add moveTo* methods, move current point in RMPath without adding a visible trace.

... ... @@ -78,6 +78,9 @@
@property (readwrite, assign) UIColor *lineColor;
@property (readwrite, assign) UIColor *fillColor;
- (void) moveToXY: (RMProjectedPoint) point;
- (void) moveToScreenPoint: (CGPoint) point;
- (void) moveToLatLong: (RMLatLong) point;
- (void) addLineToXY: (RMProjectedPoint) point;
- (void) addLineToScreenPoint: (CGPoint) point;
- (void) addLineToLatLong: (RMLatLong) point;
... ...
... ... @@ -113,7 +113,7 @@
// RMLog(@"new anchor point %f %f", self.anchorPoint.x, self.anchorPoint.y);
}
- (void) addLineToXY: (RMProjectedPoint) point
- (void) addPointToXY: (RMProjectedPoint) point withDrawing: (BOOL)isDrawing
{
// RMLog(@"addLineToXY %f %f", point.easting, point.northing);
... ... @@ -136,13 +136,41 @@
point.easting = point.easting - origin.easting;
point.northing = point.northing - origin.northing;
CGPathAddLineToPoint(path, NULL, point.easting, -point.northing);
if (isDrawing)
{
CGPathAddLineToPoint(path, NULL, point.easting, -point.northing);
} else {
CGPathMoveToPoint(path, NULL, point.easting, -point.northing);
}
[self recalculateGeometry];
}
[self setNeedsDisplay];
}
- (void) moveToXY: (RMProjectedPoint) point
{
[self addPointToXY: point withDrawing: FALSE];
}
- (void) moveToScreenPoint: (CGPoint) point
{
RMProjectedPoint mercator = [[contents mercatorToScreenProjection] projectScreenPointToXY: point];
[self moveToXY: mercator];
}
- (void) moveToLatLong: (RMLatLong) point
{
RMProjectedPoint mercator = [[contents projection] latLongToPoint:point];
[self moveToXY:mercator];
}
- (void) addLineToXY: (RMProjectedPoint) point
{
[self addPointToXY: point withDrawing: TRUE];
}
- (void) addLineToScreenPoint: (CGPoint) point
{
RMProjectedPoint mercator = [[contents mercatorToScreenProjection] projectScreenPointToXY: point];
... ...