Ticket #3677: 0001-Center-images-smaller-than-the-canvas-SL-3677.patch

File 0001-Center-images-smaller-than-the-canvas-SL-3677.patch, 1.2 KB (added by humitos, 12 years ago)
  • Area.py

    From 0ed83e849f6952afe47d22ae6480c05581bf239e Mon Sep 17 00:00:00 2001
    From: Manuel Kaufmann <humitos@gmail.com>
    Date: Tue, 12 Jun 2012 07:59:09 -0300
    Subject: [PATCH Paint] Center images smaller than the canvas SL #3677
    
    Instead of showing the image at the top of the canvas we center it.
    
    Signed-off-by: Manuel Kaufmann <humitos@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 b class Area(gtk.DrawingArea): 
    12521252                height, width, dither=gtk.gdk.RGB_DITHER_NORMAL,
    12531253                x_dither=0, y_dither=0)
    12541254
    1255             self.activity.center_area()
     1255            self.activity.fixed.move(0, 0)
    12561256
    12571257        del temp_pix
    12581258
  • OficinaActivity.py

    diff --git a/OficinaActivity.py b/OficinaActivity.py
    index 1745d0a..a74b7c1 100644
    a b class OficinaActivity(activity.Activity): 
    207207
    208208    def center_area(self):
    209209        x, y = self._get_area_displacement()
    210         self.fixed.move(self.area, x, 0)
     210        self.fixed.move(self.area, x, y)
    211211
    212212    def move_textview(self, dx, dy):
    213213        x, y = self._get_area_displacement()