This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gui][patch] set default color in GdkGraphics.setColor


Hello,

I committed this to the gui branch.  It fixes a bug reported by Michael
Koch.

Tom

2004-03-10  Thomas Fitzsimmons  <fitzsim@redhat.com>

	* gnu/java/awt/peer/gtk/GdkGraphics.java (setColor): Default to
	black when color argument is null.


Index: gnu/java/awt/peer/gtk/GdkGraphics.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java,v
retrieving revision 1.4.16.1
diff -u -r1.4.16.1 GdkGraphics.java
--- gnu/java/awt/peer/gtk/GdkGraphics.java	27 Feb 2004 19:43:40 -0000	1.4.16.1
+++ gnu/java/awt/peer/gtk/GdkGraphics.java	11 Mar 2004 00:50:34 -0000
@@ -287,7 +287,10 @@
 
   public void setColor (Color c)
   {
-    color = c;
+    if (c == null)
+      color = new Color (0, 0, 0);
+    else
+      color = c;
 
     if (xorColor == null) /* paint mode */
       setFGColor (color.getRed (), color.getGreen (), color.getBlue ());



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]