0001-fix-2053-Paint-starts-with-a-random-color-selected.patch<br>[gonzalo@aronax mainline]$ cat 0001-fix-2053-Paint-starts-with-a-random-color-selected.patch <br>From 260becfc6279bd871afe9fb4fb7f5dd9f0e7d59f Mon Sep 17 00:00:00 2001<br>
From: Gonzalo Odiard &lt;<a href="mailto:godiard@gmail.com">godiard@gmail.com</a>&gt;<br>Date: Fri, 18 Jun 2010 01:49:22 -0300<br>Subject: [PATCH] fix #2053 - Paint starts with a random color selected<br><br><a href="http://bugs.sugarlabs.org/ticket/2053">http://bugs.sugarlabs.org/ticket/2053</a><br>
---<br> Area.py |   20 ++++++++++----------<br> 1 files changed, 10 insertions(+), 10 deletions(-)<br><br>diff --git a/Area.py b/Area.py<br>index ff9a29b..f610de3 100644<br>--- a/Area.py<br>+++ b/Area.py<br>@@ -218,23 +218,24 @@ class Area(gtk.DrawingArea):<br>
         self.gc = win.new_gc()    <br>         self.gc_eraser = win.new_gc()<br>         colormap = self.get_colormap()<br>-        white = colormap.alloc_color(&#39;#ffffff&#39;, True, True) # white      <br>-        self.gc_eraser.set_foreground(white)<br>
+        self.white = colormap.alloc_color(&#39;#ffffff&#39;, True, True) # white<br>+        self.black = colormap.alloc_color(&#39;#000000&#39;, True, True)  # black<br>+<br>+        self.gc_eraser.set_foreground(self.white)<br>
         self.gc_rainbow = win.new_gc()<br>         <br>         self.gc_brush = win.new_gc()      <br>-        self.gc_brush.set_foreground(white)<br>+        self.gc_brush.set_foreground(self.black)<br>                 <br>
         self.gc_line = win.new_gc()   <br> <br>         self.gc_selection = win.new_gc()  <br>         self.gc_selection.set_line_attributes(1, gtk.gdk.LINE_ON_OFF_DASH, gtk.gdk.CAP_ROUND, gtk.gdk.JOIN_ROUND)<br>-        black = colormap.alloc_color(&#39;#000000&#39;, True, True)  # black<br>
-        self.gc_selection.set_foreground(black)<br>+        self.gc_selection.set_foreground(self.black)<br>         <br>         self.gc_selection1 = win.new_gc()  #this make another white line out of the black line<br>
         self.gc_selection1.set_line_attributes(1, gtk.gdk.LINE_ON_OFF_DASH, gtk.gdk.CAP_ROUND, gtk.gdk.JOIN_ROUND)<br>-        self.gc_selection1.set_foreground(white)<br>+        self.gc_selection1.set_foreground(self.white)<br>
         <br>         <br>         self.enableUndo(self)<br>@@ -1080,10 +1081,9 @@ class Area(gtk.DrawingArea):<br>                        &#39;fill&#39;: a Boolean value<br>                        &#39;vertices&#39;: a integer<br>
         &#39;&#39;&#39;<br>-        logging.debug(&#39;Area.set_tool&#39;)<br>+        logging.debug(&#39;Area.set_tool %s&#39;,tool)<br>         <br>         #FIXME: self.tool should be a dict too.<br>-        print tool<br>
         <br>         self.tool = tool<br>         <br>@@ -1095,13 +1095,13 @@ class Area(gtk.DrawingArea):<br>                 self.set_fill_color(self.tool[&#39;fill color&#39;])<br>             else:<br>                 # use black<br>
-                self.set_fill_color( gtk.gdk.Color(0,0,0) )<br>+                self.set_fill_color(self.black)<br>                 <br>             if self.tool[&#39;stroke color&#39;] is not None:<br>                 self.set_stroke_color(self.tool[&#39;stroke color&#39;])<br>
             else:<br>                 # use black<br>-                self.set_stroke_color( gtk.gdk.Color(0,0,0) )<br>+                self.set_stroke_color(self.black)<br>         <br>         except AttributeError:<br>
             pass<br>-- <br>1.7.0.1<br><br>