Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/OficinaActivity.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-10-02 14:48:31 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-10-02 20:52:49 (GMT)
commitf6198bd9019c85cc4ee16ae5a8e1d70ee8d4eb1a (patch)
tree471a3e6b8533ac7ba966188ddb8a1739f01e8be1 /OficinaActivity.py
parent1df3e8f52bc19af58daac4a0e8e81b2c1469de22 (diff)
Use a similar surface to improve performance
As the surface is created in draw callback, we need delay some operations until the surface is created. The undo keep is delayed until finish draw, then enable_undo() now only enable a flag, and a new method keep_undo() do the real task. This patch breaks rotation and mirror, will be adressed in another patch. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'OficinaActivity.py')
-rw-r--r--OficinaActivity.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/OficinaActivity.py b/OficinaActivity.py
index 29cb2d3..f002a95 100644
--- a/OficinaActivity.py
+++ b/OficinaActivity.py
@@ -114,7 +114,7 @@ class OficinaActivity(activity.Activity):
def map_cp(widget):
def size_allocate_cb(widget, allocation):
- self.fixed.disconnect(self._setup_handle)
+ widget.disconnect(self._setup_handle)
self.area.setup(allocation.width, allocation.height)
self.center_area()
@@ -145,9 +145,10 @@ class OficinaActivity(activity.Activity):
def size_allocate_cb(widget, allocation):
logging.error('read file size allocate')
self.fixed.disconnect(self._setup_handle)
- width = self.area.drawing_canvas.get_width()
- height = self.area.drawing_canvas.get_height()
- self.area.setup(width, height)
+ width = self.area.drawing_canvas_data.get_width()
+ height = self.area.drawing_canvas_data.get_height()
+ if self.area.drawing_canvas is None:
+ self.area.setup(width, height)
# The scrolled window is confused with a image of the same size
# of the canvas when the toolbars popup and the scrolls
# keep visible.