Convert points correctly to device. Tweak zoom factor logic a bit
This commit is contained in:
parent
1b869a04f8
commit
6c16653173
@ -3,8 +3,8 @@ import pango
|
|||||||
from sugar.graphics import units
|
from sugar.graphics import units
|
||||||
|
|
||||||
_system_fonts = {
|
_system_fonts = {
|
||||||
'default' : 'Bitstream Vera Sans %dpx' % units.points_to_pixels(9),
|
'default' : 'Bitstream Vera Sans %d' % units.points_to_device(9),
|
||||||
'default-bold' : 'Bitstream Vera Sans bold %dpx' % units.points_to_pixels(9)
|
'default-bold' : 'Bitstream Vera Sans bold %d' % units.points_to_device(9)
|
||||||
}
|
}
|
||||||
|
|
||||||
class Font(object):
|
class Font(object):
|
||||||
|
@ -64,7 +64,7 @@ import gtk
|
|||||||
import _sugar
|
import _sugar
|
||||||
|
|
||||||
_MAX_ZOOM_FACTOR = 1.5
|
_MAX_ZOOM_FACTOR = 1.5
|
||||||
_ZOOM_CONSTANT = 600.0
|
_ZOOM_CONSTANT = 800.0
|
||||||
|
|
||||||
def _compute_zoom_factor():
|
def _compute_zoom_factor():
|
||||||
screen_width = gtk.gdk.screen_width()
|
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
|
LARGE_ICON_SCALE = 2.0 * _dpi_factor * _zoom_factor
|
||||||
XLARGE_ICON_SCALE = 3.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):
|
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):
|
def grid_to_pixels(units):
|
||||||
return int(units * 75.0 * _dpi_factor * _zoom_factor)
|
return int(units * 75.0 * _dpi_factor * _zoom_factor)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
VERSION=0.63
|
VERSION=0.63
|
||||||
DATE=`date +%Y%m%d`
|
DATE=`date +%Y%m%d`
|
||||||
RELEASE=2.27
|
RELEASE=2.29
|
||||||
TARBALL=sugar-$VERSION-$RELEASE.${DATE}git.tar.bz2
|
TARBALL=sugar-$VERSION-$RELEASE.${DATE}git.tar.bz2
|
||||||
|
|
||||||
rm sugar-$VERSION.tar.bz2
|
rm sugar-$VERSION.tar.bz2
|
||||||
|
Loading…
Reference in New Issue
Block a user