Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2013-05-29 19:46:23 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-05-29 21:04:47 (GMT)
commitd5a892e5804d350541e8c73d495245cba6632c3c (patch)
tree754913ac2d63ffa44a8e1d8e24ba5cf560d795f1
parent8d21cdabafd50dff20eba452922aceed02cffdb5 (diff)
If a selection is active, clear operation should clean it - SL #4476
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r--Desenho.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/Desenho.py b/Desenho.py
index 392f042..7c734b1 100644
--- a/Desenho.py
+++ b/Desenho.py
@@ -597,11 +597,16 @@ class Desenho:
width, height = widget.get_size()
# try to clear a selected area first
if widget.is_selected():
- x, y, width, height = widget.get_selection_bounds()
-
- widget.drawing_ctx.rectangle(x, y, width, height)
- widget.drawing_ctx.set_source_rgb(1.0, 1.0, 1.0)
- widget.drawing_ctx.fill()
+ selection_surface = widget.get_selection()
+ _x, _y, width, height = widget.get_selection_bounds()
+ ctx = cairo.Context(selection_surface)
+ ctx.rectangle(0, 0, width, height)
+ ctx.set_source_rgb(1.0, 1.0, 1.0)
+ ctx.fill()
+ else:
+ widget.drawing_ctx.rectangle(x, y, width, height)
+ widget.drawing_ctx.set_source_rgb(1.0, 1.0, 1.0)
+ widget.drawing_ctx.fill()
widget.queue_draw()