Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Desenho.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-07-24 18:21:43 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-08-10 13:49:30 (GMT)
commit1a0de2965f7a9c3b147b6b08054f648cd4bc3614 (patch)
treebbd5084777c7c45e38d96dbbe3165210a80fdbe3 /Desenho.py
parentca94b8e6eaf957b439486e4ab93725586e530e57 (diff)
Implement stamp tool with cairo
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'Desenho.py')
-rw-r--r--Desenho.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/Desenho.py b/Desenho.py
index 939a0a9..7917a55 100644
--- a/Desenho.py
+++ b/Desenho.py
@@ -164,15 +164,21 @@ class Desenho:
@param stamp_size -- integer (default 20)
"""
+
widget.desenha = False
- gc = widget.gc_brush
width = widget.resized_stamp.get_width()
height = widget.resized_stamp.get_height()
dx = coords[0] - width / 2
dy = coords[1] - height / 2
- widget.pixmap.draw_pixbuf(gc, widget.resized_stamp,
- 0, 0, dx, dy, width, height)
+
+ widget.drawing_ctx.save()
+ widget.drawing_ctx.translate(dx, dy)
+ widget.drawing_ctx.rectangle(dx, dy, width, height)
+ temp_ctx = gtk.gdk.CairoContext(widget.drawing_ctx)
+ temp_ctx.set_source_pixbuf(widget.resized_stamp, 0, 0)
+ widget.drawing_ctx.paint()
+ widget.drawing_ctx.restore()
widget.queue_draw()