bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug awt/27700] Graphics2D.drawImage(Image, int, int, int, int, int, int


From: pere at hungry dot com
Subject: [Bug awt/27700] Graphics2D.drawImage(Image, int, int, int, int, int, int, int, int, Color, ImageObserver) creates an uninvertable AffineTransform
Date: 24 May 2006 10:34:55 -0000


------- Comment #5 from pere at hungry dot com  2006-05-24 10:34 -------
Assuming the problem was a source or destination image with zero width or
height, I tested the following workaround and managed to get the openstreetmap
applet to run as it should using the CVS version of classpath.  I have no idea
if this is the correct way to fix it, but it solve my problem.

Index: GdkGraphics2D.java
===================================================================
RCS file:
/sources/classpath/classpath/gnu/java/awt/peer/gtk/GdkGraphics2D.java,v
retrieving revision 1.55
diff -u -3 -p -u -r1.55 GdkGraphics2D.java
--- GdkGraphics2D.java  3 May 2006 10:28:54 -0000       1.55
+++ GdkGraphics2D.java  24 May 2006 10:32:41 -0000
@@ -1460,6 +1460,10 @@ public class GdkGraphics2D extends Graph
     int destWidth = dx2 - dx1;
     int destHeight = dy2 - dy1;

+    if (0 == sourceWidth || 0 == sourceHeight
+       || 0 == destWidth || 0 == destHeight)
+      return false;
+
     double scaleX = destWidth / (double) sourceWidth;
     double scaleY = destHeight / (double) sourceHeight;



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27700





reply via email to

[Prev in Thread] Current Thread [Next in Thread]