Convert points correctly to device. Tweak zoom factor logic a bit

This commit is contained in:
Marco Pesenti Gritti 2007-02-28 21:04:26 +01:00
parent 1b869a04f8
commit 6c16653173
3 changed files with 8 additions and 5 deletions

View File

@ -3,8 +3,8 @@ import pango
from sugar.graphics import units
_system_fonts = {
'default' : 'Bitstream Vera Sans %dpx' % units.points_to_pixels(9),
'default-bold' : 'Bitstream Vera Sans bold %dpx' % units.points_to_pixels(9)
'default' : 'Bitstream Vera Sans %d' % units.points_to_device(9),
'default-bold' : 'Bitstream Vera Sans bold %d' % units.points_to_device(9)
}
class Font(object):

View File

@ -64,7 +64,7 @@ import gtk
import _sugar
_MAX_ZOOM_FACTOR = 1.5
_ZOOM_CONSTANT = 600.0
_ZOOM_CONSTANT = 800.0
def _compute_zoom_factor():
screen_width = gtk.gdk.screen_width()
@ -83,8 +83,11 @@ MEDIUM_ICON_SCALE = 1.5 * _dpi_factor * _zoom_factor
LARGE_ICON_SCALE = 2.0 * _dpi_factor * _zoom_factor
XLARGE_ICON_SCALE = 3.0 * _dpi_factor * _zoom_factor
def points_to_device(points):
return int(points * _zoom_factor)
def points_to_pixels(points):
return int(points * _screen_dpi * 72.0 * _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)

View File

@ -1,6 +1,6 @@
VERSION=0.63
DATE=`date +%Y%m%d`
RELEASE=2.27
RELEASE=2.29
TARBALL=sugar-$VERSION-$RELEASE.${DATE}git.tar.bz2
rm sugar-$VERSION.tar.bz2