Authored by Quazie

Fixed things noted by Hal, specifically added CGPointZero and CGRectZero

... ... @@ -45,7 +45,7 @@
// strange data.
layer = [[CAScrollLayer layer] retain];
layer.anchorPoint = kTheOrigin;
layer.anchorPoint = CGPointZero;
layer.masksToBounds = YES;
// If the frame is set incorrectly here, it will be fixed when setRenderer is called in RMMapContents
layer.frame = [content screenBounds];
... ...
... ... @@ -7,7 +7,5 @@
*
*/
#define kTheOrigin CGPointMake(0,0)
#define kEmptyRect CGRectMake(0, 0, 0, 0)
#define kMaxLong 180
#define kMaxLat 90
\ No newline at end of file
... ...
... ... @@ -746,7 +746,7 @@
if (mercatorToScreenProjection != nil)
return [mercatorToScreenProjection screenBounds];
else
return kEmptyRect;
return CGRectZero;
}
-(float) metersPerPixel
... ... @@ -757,7 +757,7 @@
-(void) setMetersPerPixel: (float) newMPP
{
float zoomFactor = newMPP / self.metersPerPixel;
CGPoint pivot = kTheOrigin;
CGPoint pivot = CGPointZero;
[mercatorToScreenProjection setMetersPerPixel:newMPP];
[imagesOnScreen zoomByFactor:zoomFactor near:pivot];
... ...
... ... @@ -115,7 +115,7 @@
//RMLog(@"test: %f %f", test.x, test.y);
//RMLog(@"correct: %f %f", origin.easting, origin.y);
// CGPoint p = [self projectMercatorPoint:[self projectScreenPointToMercator:kTheOrigin]];
// CGPoint p = [self projectMercatorPoint:[self projectScreenPointToMercator:CGPointZero]];
// RMLog(@"origin at %f %f", p.x, p.y);
// CGPoint q = [self projectMercatorPoint:[self projectScreenPointToMercator:CGPointMake(100,100)]];
// RMLog(@"100 100 at %f %f", q.x, q.y);
... ...
... ... @@ -91,7 +91,7 @@
boundsInMercators.size.width += 2*lineWidth;
boundsInMercators.size.height += 2*lineWidth;
CGRect pixelBounds = RMScaleCGRectAboutPoint(boundsInMercators, 1.0f / scale, kTheOrigin);
CGRect pixelBounds = RMScaleCGRectAboutPoint(boundsInMercators, 1.0f / scale, CGPointZero);
// RMLog(@"old bounds: %f %f %f %f", self.bounds.origin.x, self.bounds.origin.y, self.bounds.size.width, self.bounds.size.height);
self.bounds = pixelBounds;
... ...
... ... @@ -52,7 +52,7 @@ NSString * const RMMapImageLoadingCancelledNotification = @"MapImageLoadingCance
loadingPriorityCount = 0;
lastUsedTime = nil;
dataPending = nil;
screenLocation = kEmptyRect;
screenLocation = CGRectZero;
[self touch];
... ... @@ -228,7 +228,7 @@ NSString * const RMMapImageLoadingCancelledNotification = @"MapImageLoadingCance
{
layer = [[CALayer alloc] init];
layer.contents = nil;
layer.anchorPoint = kTheOrigin;
layer.anchorPoint = CGPointZero;
layer.bounds = CGRectMake(0, 0, screenLocation.size.width, screenLocation.size.height);
layer.position = screenLocation.origin;
... ...
... ... @@ -80,7 +80,7 @@ NSString* const RMTileRequested = @"RMTileRequested";
-(void) clearLoadedBounds
{
loadedBounds = kEmptyRect;
loadedBounds = CGRectZero;
// loadedTiles.origin.tile = RMTileDummy();
}
-(BOOL) screenIsLoaded
... ...
... ... @@ -55,7 +55,7 @@
RMXYRect boundsRect = tileProjection.bounds;
layer.bounds = CGRectMake(boundsRect.origin.x, boundsRect.origin.y, boundsRect.size.width, boundsRect.size.height) ;
layer.position = kTheOrigin;
layer.position = CGPointZero;
[self setScale:1];
[layer setNeedsDisplay];
... ...