diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-28 18:05:56 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-28 18:05:56 (GMT) |
commit | abc400f84106b70905c6136253590dc59922a562 (patch) | |
tree | 8028a2487fb69f049abc32b5684c6395c8ea8559 /sugar/graphics/units.py | |
parent | 458aaf3786b74758b8aa8b7aac8688c3bca43ed2 (diff) |
Fix points_to_pixels impl
Diffstat (limited to 'sugar/graphics/units.py')
-rw-r--r-- | sugar/graphics/units.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sugar/graphics/units.py b/sugar/graphics/units.py index 397b702..ec3958e 100644 --- a/sugar/graphics/units.py +++ b/sugar/graphics/units.py @@ -73,7 +73,8 @@ def _compute_zoom_factor(): else: return min(_MAX_ZOOM_FACTOR, screen_width / _ZOOM_CONSTANT) -_dpi_factor = float(_sugar.get_screen_dpi()) / 201.0 +_screen_dpi = float(_sugar.get_screen_dpi()) +_dpi_factor = _screen_dpi / 201.0 _zoom_factor = _compute_zoom_factor() STANDARD_ICON_SCALE = 1.0 * _dpi_factor * _zoom_factor @@ -83,7 +84,7 @@ LARGE_ICON_SCALE = 2.0 * _dpi_factor * _zoom_factor XLARGE_ICON_SCALE = 3.0 * _dpi_factor * _zoom_factor def points_to_pixels(points): - return int(points * _zoom_factor) + return int(points * _screen_dpi * 72.0 * _zoom_factor) def grid_to_pixels(units): return int(units * 75.0 * _dpi_factor * _zoom_factor) |