From 197c45e3f5c5a0b3b9aa5bc3a74aa3679dfb00e5 Mon Sep 17 00:00:00 2001 From: Fred Kiefer Date: Thu, 29 Oct 2009 08:00:41 +0000 Subject: [PATCH] Correct drawing of pattern colour. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@28911 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 23 +++++++++++++++-------- Source/gsc/GSGState.m | 16 +++++++++++++--- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 208b576..b9dbaa1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,23 +1,30 @@ +2009-10-29 Fred Kiefer + + * Source/gsc/GSGState.m (-_fillRect:withPattern:): Convert the + drawing coordinate back in user space. + 2009-10-28 Thomas Gamper + * Source/x11/XGGLFormat.m - Check for GLX_VERSION_1_4. + Check for GLX_VERSION_1_4. 2009-10-28 Riccardo Mottola + * Source/x11/XGGLFormat.m cleaned up c99-isms 2009-10-25 Thomas Gamper - * Source/x11/XGServerWindow.m - Implement setMouseLocation:onScreen:. + * Source/x11/XGServerWindow.m + Implement setMouseLocation:onScreen:. 2009-10-25 Thomas Gamper - * Source/x11/XGGLContext.m - * Source/x11/XGGLFormat.m - * Headers/x11/XGOpenGL.h - Clean up OpenGL stuff, reformat code and add Multisampling - support. + * Source/x11/XGGLContext.m + * Source/x11/XGGLFormat.m + * Headers/x11/XGOpenGL.h + Clean up OpenGL stuff, reformat code and add Multisampling + support. 2009-10-23 Fred Kiefer diff --git a/Source/gsc/GSGState.m b/Source/gsc/GSGState.m index 1b06a8e..46487c9 100644 --- a/Source/gsc/GSGState.m +++ b/Source/gsc/GSGState.m @@ -1236,6 +1236,12 @@ typedef enum { NSSize size; float x; float y; + NSAffineTransform *ictm; + + // The coordinates we get here are already in device space, + // but compositeToPoint needs user space coordinates + ictm = [ctm copyWithZone: GSObjCZone(self)]; + [ictm invert]; size = [pattern size]; y = floor(NSMinY(rect) / size.height) * size.height; @@ -1243,13 +1249,17 @@ typedef enum { { x = floor(NSMinX(rect) / size.width) * size.width; while (x < NSMaxX(rect)) - { - [color_pattern compositeToPoint: NSMakePoint(x, y) + { + NSPoint p = NSMakePoint(x, y); + + p = [ictm pointInMatrixSpace: p]; + [color_pattern compositeToPoint: p operation: NSCompositeSourceOver]; x += size.width; - } + } y += size.height; } + RELEASE(ictm); } - (void) fillRect: (NSRect)rect withPattern: (NSImage*)color_pattern