Ticket #2966: 0001-Initial-stamp-size-set-based-on-the-display-s-DPI.patch

File 0001-Initial-stamp-size-set-based-on-the-display-s-DPI.patch, 1.4 KB (added by manuq, 13 years ago)
  • Area.py

    From 794da0233c80da2a8fe0c4907c34caccedacd202 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
    Date: Mon, 15 Aug 2011 13:53:53 -0300
    Subject: [PATCH] Initial stamp size set based on the display's DPI
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    
    Fixes SL #2966 .
    
    Signed-off-by: Manuel Quiñones <manuq@laptop.org>
    ---
     Area.py |    8 +++++++-
     1 files changed, 7 insertions(+), 1 deletions(-)
    
    diff --git a/Area.py b/Area.py
    index 2e40d00..d953005 100644
    a b import pango 
    7272from fill import fill
    7373from Desenho import Desenho
    7474from urlparse import urlparse
     75from sugar.graphics.style import zoom
     76
    7577
    7678##Tools and events manipulation are handle with this class.
    7779
    class Area(gtk.DrawingArea): 
    139141        self.tool = {
    140142            'name': 'pencil',
    141143            'line size': 4,
    142             'stamp size': 20,
     144            'stamp size': self._get_stamp_size(),
    143145            'fill color': None,
    144146            'stroke color': None,
    145147            'line shape': 'circle',
    class Area(gtk.DrawingArea): 
    187189        self.x_cursor = 0
    188190        self.y_cursor = 0
    189191
     192    def _get_stamp_size(self):
     193        """Set the stamp initial size, based on the display DPI."""
     194        return zoom(44)
     195
    190196    def setup(self, width, height):
    191197        """Configure the Area object."""
    192198