From 1a0de2965f7a9c3b147b6b08054f648cd4bc3614 Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Tue, 24 Jul 2012 18:21:43 +0000 Subject: Implement stamp tool with cairo Signed-off-by: Gonzalo Odiard --- (limited to 'Desenho.py') 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() -- cgit v0.9.1