This fixes a problem with clipping for drawImage(). There used to be a
setClip() in drawImage() which replaces the current clip with something
computed in this method. However, it should really intersect the current
clip with the computed one. This fixes painting issues in Swing apps
like reported for Hades.
2006-06-16 Roman Kennke <[EMAIL PROTECTED]>
PR 28027
* gnu/java/awt/peer/gtk/CairoGraphics2D.java
(drawImage): Don't use setClip() but instead clipRect() to
intersect the current clip with a new one.
/Roman
Index: gnu/java/awt/peer/gtk/CairoGraphics2D.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java,v
retrieving revision 1.24
diff -u -1 -0 -r1.24 CairoGraphics2D.java
--- gnu/java/awt/peer/gtk/CairoGraphics2D.java 15 Jun 2006 08:42:55 -0000 1.24
+++ gnu/java/awt/peer/gtk/CairoGraphics2D.java 16 Jun 2006 10:24:36 -0000
@@ -1351,21 +1351,21 @@
int cx, cy, cw, ch;
if( dx1 < dx2 )
{ cx = dx1; cw = dx2 - dx1; }
else
{ cx = dx2; cw = dx1 - dx2; }
if( dy1 < dy2 )
{ cy = dy1; ch = dy2 - dy1; }
else
{ cy = dy2; ch = dy1 - dy2; }
- setClip( cx, cy, cw, ch );
+ clipRect( cx, cy, cw, ch );
AffineTransform tx = new AffineTransform();
tx.translate( dx1 - sx1*scaleX, dy1 - sy1*scaleY );
tx.scale( scaleX, scaleY );
boolean retval = drawImage(img, tx, bgcolor, observer);
setClip( oldClip );
return retval;
}