Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSayamindu Dasgupta <sayamindu@gmail.com>2008-09-09 14:24:36 (GMT)
committer Morgan Collett <morgan.collett@gmail.com>2008-09-09 15:10:26 (GMT)
commit8cef4eb4bbcf8e4beb68d8c4e54832618cc712de (patch)
tree6324d217355422cf7b54baa22327fbbdd7ae53cb
parenta71d8f0c45a4aebb7991a7550f49a2087b356c33 (diff)
Make pencil tool use the brush (partial workaround for #8285)
-rw-r--r--Area.py16
-rw-r--r--Desenho.py16
2 files changed, 10 insertions, 22 deletions
diff --git a/Area.py b/Area.py
index e2ba9da..49269f9 100644
--- a/Area.py
+++ b/Area.py
@@ -350,11 +350,17 @@ class Area(gtk.DrawingArea):
@param event -- GdkEvent
"""
- x , y, state = event.window.get_pointer()
+ x = event.x
+ y = event.y
+ state = event.state
+
coords = int(x), int(y)
if state & gtk.gdk.BUTTON1_MASK and self.pixmap != None:
- if self.tool['name'] == 'eraser':
+ if self.tool['name'] == 'pencil':
+ self.d.brush(widget, coords, self.last, 2, 'circle')
+ self.last = coords
+ elif self.tool['name'] == 'eraser':
self.d.eraser(widget, coords, self.last, self.line_size, self.tool['line shape'])
self.last = coords
elif self.tool['name'] == 'brush':
@@ -371,10 +377,6 @@ class Area(gtk.DrawingArea):
self.configure_line(self.line_size)
self.d.line(widget, coords)
- elif self.tool['name'] == 'pencil':
- self.configure_line(self.line_size)
- self.d.pencil(widget, coords)
-
elif self.tool['name'] == 'ellipse':
self.configure_line(self.line_size)
self.d.circle(widget,coords,True,self.tool['fill'])
@@ -438,6 +440,8 @@ class Area(gtk.DrawingArea):
self.configure_line(self.line_size)
self.d.polygon(widget,coords,True,self.tool['fill'],"moving")
+ gtk.gdk.event_request_motions (event)
+
def mouseup(self,widget,event):
"""Make the Area object (GtkDrawingArea) recognize that the mouse was released.
diff --git a/Desenho.py b/Desenho.py
index 88c3449..91d19f2 100644
--- a/Desenho.py
+++ b/Desenho.py
@@ -471,22 +471,6 @@ class Desenho:
pixmap.draw_arc(widget.gc_line,False,x,y,dx,dy,0,360*64)
widget.queue_draw()
-
- def pencil(self, widget, coords):
- """Draw a pencil.
-
- @param self -- Desenho.Desenho instance
- @param widget -- Area object (GtkDrawingArea)
- @param coords -- Two value tuple
-
- """
- width, height = widget.window.get_size()
- widget.pixmap_temp.draw_drawable(widget.gc,widget.pixmap, 0 , 0 ,0,0, width, height)
- widget.pixmap.draw_line(widget.gc_line,widget.oldx,widget.oldy,coords[0],coords[1])
- widget.oldx = coords[0]
- widget.oldy = coords[1]
- widget.queue_draw()
-
def clear(self, widget):
"""Clear the drawing.