[Sugar-devel] [PATCH Paint] Center images smaller than the canvas SL #3677

Manuel Kaufmann humitos at gmail.com
Tue Jun 12 07:00:35 EDT 2012


Instead of showing the image at the top of the canvas we center it.

Signed-off-by: Manuel Kaufmann <humitos at gmail.com>
---
 Area.py            |    2 +-
 OficinaActivity.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Area.py b/Area.py
index d8997a1..b8d135c 100644
--- a/Area.py
+++ b/Area.py
@@ -1252,7 +1252,7 @@ class Area(gtk.DrawingArea):
                 height, width, dither=gtk.gdk.RGB_DITHER_NORMAL,
                 x_dither=0, y_dither=0)
 
-            self.activity.center_area()
+            self.activity.fixed.move(0, 0)
 
         del temp_pix
 
diff --git a/OficinaActivity.py b/OficinaActivity.py
index 1745d0a..a74b7c1 100644
--- a/OficinaActivity.py
+++ b/OficinaActivity.py
@@ -207,7 +207,7 @@ class OficinaActivity(activity.Activity):
 
     def center_area(self):
         x, y = self._get_area_displacement()
-        self.fixed.move(self.area, x, 0)
+        self.fixed.move(self.area, x, y)
 
     def move_textview(self, dx, dy):
         x, y = self._get_area_displacement()
-- 
1.7.10.2



More information about the Sugar-devel mailing list