diff --git a/sugar/graphics/units.py b/sugar/graphics/units.py index 397b7028..ec3958e7 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)