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 |
72 | 72 | from fill import fill |
73 | 73 | from Desenho import Desenho |
74 | 74 | from urlparse import urlparse |
| 75 | from sugar.graphics.style import zoom |
| 76 | |
75 | 77 | |
76 | 78 | ##Tools and events manipulation are handle with this class. |
77 | 79 | |
… |
… |
class Area(gtk.DrawingArea): |
139 | 141 | self.tool = { |
140 | 142 | 'name': 'pencil', |
141 | 143 | 'line size': 4, |
142 | | 'stamp size': 20, |
| 144 | 'stamp size': self._get_stamp_size(), |
143 | 145 | 'fill color': None, |
144 | 146 | 'stroke color': None, |
145 | 147 | 'line shape': 'circle', |
… |
… |
class Area(gtk.DrawingArea): |
187 | 189 | self.x_cursor = 0 |
188 | 190 | self.y_cursor = 0 |
189 | 191 | |
| 192 | def _get_stamp_size(self): |
| 193 | """Set the stamp initial size, based on the display DPI.""" |
| 194 | return zoom(44) |
| 195 | |
190 | 196 | def setup(self, width, height): |
191 | 197 | """Configure the Area object.""" |
192 | 198 | |