[webkit-changes] cvs commit: WebKit/WebCoreSupport.subproj
WebImageData.m
Darin
darin at opensource.apple.com
Tue Aug 16 22:01:30 PDT 2005
darin 05/08/16 22:01:29
Modified: . ChangeLog
WebCoreSupport.subproj WebImageData.m
Log:
Reviewed by Trey.
- improved fix for <rdar://problem/4211631>, tiled images tiled incorrectly when printing or
drawing offscreen
* WebCoreSupport.subproj/WebImageData.m: (-[WebImageData tileInRect:fromPoint:context:]):
Fix pattern phase origin to use the image tile origin, which is clearly right, rather than
the image rectangle, which isn't right, but often is the same.
Revision Changes Path
1.3294 +12 -1 WebKit/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebKit/ChangeLog,v
retrieving revision 1.3293
retrieving revision 1.3294
diff -u -r1.3293 -r1.3294
--- ChangeLog 17 Aug 2005 01:29:08 -0000 1.3293
+++ ChangeLog 17 Aug 2005 05:01:22 -0000 1.3294
@@ -1,3 +1,14 @@
+2005-08-16 Darin Adler <darin at apple.com>
+
+ Reviewed by Trey.
+
+ - improved fix for <rdar://problem/4211631>, tiled images tiled incorrectly when printing or
+ drawing offscreen
+
+ * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData tileInRect:fromPoint:context:]):
+ Fix pattern phase origin to use the image tile origin, which is clearly right, rather than
+ the image rectangle, which isn't right, but often is the same.
+
2005-08-16 Adele Peterson <adele at apple.com>
Reviewed by John.
@@ -94,7 +105,7 @@
(-[WebImageRendererFactory imageRendererWithSize:]): Ditto.
(-[WebImageRendererFactory imageRendererWithName:]): Ditto.
-2005-08-15 Darin <darin at apple.com>
+2005-08-15 Darin Adler <darin at apple.com>
Reviewed by Beth.
1.45 +2 -7 WebKit/WebCoreSupport.subproj/WebImageData.m
Index: WebImageData.m
===================================================================
RCS file: /cvs/root/WebKit/WebCoreSupport.subproj/WebImageData.m,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- WebImageData.m 16 Aug 2005 17:36:37 -0000 1.44
+++ WebImageData.m 17 Aug 2005 05:01:29 -0000 1.45
@@ -589,12 +589,6 @@
NSRect oneTileRect;
oneTileRect.origin.x = rect.origin.x + fmodf(fmodf(-point.x, tileSize.width) - tileSize.width, tileSize.width);
oneTileRect.origin.y = rect.origin.y + fmodf(fmodf(-point.y, tileSize.height) - tileSize.height, tileSize.height);
-// I think this is a simpler way to say the same thing. Also, if either point.x or point.y is negative, both
-// methods will end up with the wrong answer. For example, fmod(-22,5) is -2, which is the correct delta to
-// the start of the pattern, but fmod(-(-23), 5) is 3. This is the delta to the *end* of the pattern
-// instead of the start, so oneTileRect will be too far right.
-// oneTileRect.origin.x = rect.origin.x - fmodf(point.x, size.width);
-// oneTileRect.origin.y = rect.origin.y - fmodf(point.y, size.height);
oneTileRect.size.height = tileSize.height;
oneTileRect.size.width = tileSize.width;
@@ -620,7 +614,8 @@
if (pattern) {
CGContextSaveGState (aContext);
- CGPoint transformedOrigin = CGPointApplyAffineTransform(rect.origin, CGContextGetCTM(aContext));
+ CGPoint tileOrigin = CGPointMake(oneTileRect.origin.x, oneTileRect.origin.y);
+ CGPoint transformedOrigin = CGPointApplyAffineTransform(tileOrigin, CGContextGetCTM(aContext));
CGContextSetPatternPhase(aContext, CGSizeMake(transformedOrigin.x, transformedOrigin.y));
CGColorSpaceRef patternSpace = CGColorSpaceCreatePattern(NULL);
More information about the webkit-changes
mailing list