Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2010-06-18 04:49:22 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2010-06-18 04:49:22 (GMT)
commit260becfc6279bd871afe9fb4fb7f5dd9f0e7d59f (patch)
tree512f166c62327f5408d1e224b035128edd79be1b
parent55bafdf0e1d7de57eccc74590a941207bce329e6 (diff)
fix #2053 - Paint starts with a random color selected
http://bugs.sugarlabs.org/ticket/2053
-rw-r--r--Area.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Area.py b/Area.py
index ff9a29b..f610de3 100644
--- a/Area.py
+++ b/Area.py
@@ -218,23 +218,24 @@ class Area(gtk.DrawingArea):
self.gc = win.new_gc()
self.gc_eraser = win.new_gc()
colormap = self.get_colormap()
- white = colormap.alloc_color('#ffffff', True, True) # white
- self.gc_eraser.set_foreground(white)
+ self.white = colormap.alloc_color('#ffffff', True, True) # white
+ self.black = colormap.alloc_color('#000000', True, True) # black
+
+ self.gc_eraser.set_foreground(self.white)
self.gc_rainbow = win.new_gc()
self.gc_brush = win.new_gc()
- self.gc_brush.set_foreground(white)
+ self.gc_brush.set_foreground(self.black)
self.gc_line = win.new_gc()
self.gc_selection = win.new_gc()
self.gc_selection.set_line_attributes(1, gtk.gdk.LINE_ON_OFF_DASH, gtk.gdk.CAP_ROUND, gtk.gdk.JOIN_ROUND)
- black = colormap.alloc_color('#000000', True, True) # black
- self.gc_selection.set_foreground(black)
+ self.gc_selection.set_foreground(self.black)
self.gc_selection1 = win.new_gc() #this make another white line out of the black line
self.gc_selection1.set_line_attributes(1, gtk.gdk.LINE_ON_OFF_DASH, gtk.gdk.CAP_ROUND, gtk.gdk.JOIN_ROUND)
- self.gc_selection1.set_foreground(white)
+ self.gc_selection1.set_foreground(self.white)
self.enableUndo(self)
@@ -1080,10 +1081,9 @@ class Area(gtk.DrawingArea):
'fill': a Boolean value
'vertices': a integer
'''
- logging.debug('Area.set_tool')
+ logging.debug('Area.set_tool %s',tool)
#FIXME: self.tool should be a dict too.
- print tool
self.tool = tool
@@ -1095,13 +1095,13 @@ class Area(gtk.DrawingArea):
self.set_fill_color(self.tool['fill color'])
else:
# use black
- self.set_fill_color( gtk.gdk.Color(0,0,0) )
+ self.set_fill_color(self.black)
if self.tool['stroke color'] is not None:
self.set_stroke_color(self.tool['stroke color'])
else:
# use black
- self.set_stroke_color( gtk.gdk.Color(0,0,0) )
+ self.set_stroke_color(self.black)
except AttributeError:
pass