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-01-11 19:48:50 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-01-11 19:48:50 (GMT)
commitd87b2bf231461b9bb1a42dbbf904366b78e523e5 (patch)
tree748743da806a4c6846260c2a8e1c3f4683d44e82
parent85aac4be684f1233d534ab10f19dc48d57a3b88d (diff)
Selection disapear - SL #4375
If there are a selection already finished, should be painted, when draw the selected area. Redraw can be triggered by events externals to what the user do, like canvas scroll due to open or close subtoolbars, or a window opened over the canvas (ObjectChooser) Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r--Area.py13
-rw-r--r--Desenho.py5
2 files changed, 13 insertions, 5 deletions
diff --git a/Area.py b/Area.py
index 271cb5f..e42be83 100644
--- a/Area.py
+++ b/Area.py
@@ -189,6 +189,7 @@ class Area(Gtk.DrawingArea):
self.last = []
self.keep_aspect_ratio = False
self.keep_shape_ratio = False
+ self._selection_finished = False
self._set_screen_dpi()
@@ -281,6 +282,15 @@ class Area(Gtk.DrawingArea):
return
x, y, width, height = self.get_selection_bounds()
+ if self._selection_finished:
+ ctx.save()
+ selection_surface = self.get_selection()
+ ctx.translate(x, y)
+ ctx.set_source_surface(selection_surface)
+ ctx.rectangle(0, 0, width, height)
+ ctx.paint()
+ ctx.restore()
+
ctx.save()
ctx.set_line_width(1)
ctx.set_source_rgba(1., 1., 1., 1.)
@@ -1433,6 +1443,7 @@ class Area(Gtk.DrawingArea):
self._selection_horizontal_scale = 1.0
self._selection_vertical_scale = 1.0
self.selection_resized_surface = None
+ self._selection_finished = False
def set_selection_bounds(self, x, y, width, height):
"""
@@ -1469,6 +1480,7 @@ class Area(Gtk.DrawingArea):
selection_ctx.set_source_surface(self.temp_canvas)
selection_ctx.paint()
self.selection_resized_surface = None
+ self._selection_finished = True
if clear_background:
self.pending_clean_selection_background = True
@@ -1569,6 +1581,7 @@ class Area(Gtk.DrawingArea):
self.set_selection_bounds(0, 0, width, height)
self.desenha = True
self._selmove = True
+ self._selection_finished = True
self.tool['name'] = 'marquee-rectangular'
self.emit('select')
diff --git a/Desenho.py b/Desenho.py
index 50ac4fa..0420f51 100644
--- a/Desenho.py
+++ b/Desenho.py
@@ -681,11 +681,6 @@ class Desenho:
widget.oldy = coords[1]
new_x, new_y = x + dx, y + dy
- widget.temp_ctx.save()
- widget.temp_ctx.translate(new_x, new_y)
- widget.temp_ctx.set_source_surface(selection_surface)
- widget.temp_ctx.paint()
- widget.temp_ctx.restore()
widget.set_selection_start(new_x, new_y)
widget.queue_draw()