From 30bfacc835d415e2ae57214b0de5baba45985224 Mon Sep 17 00:00:00 2001 From: Mark Tracy Date: Sun, 31 Dec 2006 04:24:54 +0000 Subject: [PATCH] Fix bug #18260 in art backend git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@24299 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 4 ++++ Source/art/ReadRect.m | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8246c4d..380ab6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-12-30 Mark Tracy + * Source/art/ReadRect.m (-GSReadRect:): incorporate offset into + coordinate transformation calculations. Fixes bug #18260 + 2006-12-28 Matt Rice * Source/x11/XGServerWindow.m (-flushwindowrect::): Don't convert diff --git a/Source/art/ReadRect.m b/Source/art/ReadRect.m index adc2f1e..013ef2a 100644 --- a/Source/art/ReadRect.m +++ b/Source/art/ReadRect.m @@ -42,7 +42,7 @@ NSMutableDictionary *md = [[NSMutableDictionary alloc] init]; NSAffineTransform *matrix; - int x0, y0, x1, y1, w, h; + int x0, y0, x1, y1, w, h, ox, oy; NSPoint p; /* Get the bounding rect in pixel coordinates. */ @@ -94,6 +94,9 @@ matrix=[ctm copy]; [matrix translateXBy: -x0 yBy: -y0]; + ox = [matrix transformPoint: NSMakePoint(0, 0)].x - offset.x; + oy = offset.y - [matrix transformPoint: NSMakePoint(0, 0)].y; + [md setObject: NSDeviceRGBColorSpace forKey: @"ColorSpace"]; [md setObject: [NSNumber numberWithUnsignedInt: 1] forKey: @"HasAlpha"]; [md setObject: [NSNumber numberWithUnsignedInt: 8] forKey: @"BitsPerSample"]; @@ -115,8 +118,8 @@ c.dst = [d mutableBytes]; - c.src = wi->data + (wi->sy - y1) * wi->bytes_per_line + x0 * DI.bytes_per_pixel; - c.srca = wi->alpha + (wi->sy - y1) * wi->sx + x0; + c.src = wi->data + (oy - y1) * wi->bytes_per_line + (x0 + ox) * DI.bytes_per_pixel; + c.srca = wi->alpha + (oy - y1) * wi->sx + (x0 + ox); for (y = 0; y < h; y++) {