From e08d9e7263fe23168d68b532f07403282e18d3c4 Mon Sep 17 00:00:00 2001 From: Richard Wilson Date: Tue, 12 Apr 2005 19:09:09 +0000 Subject: [project @ 2005-04-12 19:09:09 by rjw] Round value up when going from OS units to pixels. svn path=/import/netsurf/; revision=1625 --- riscos/wimp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'riscos/wimp.c') diff --git a/riscos/wimp.c b/riscos/wimp.c index 0b4e044b7..9500c6abb 100644 --- a/riscos/wimp.c +++ b/riscos/wimp.c @@ -113,11 +113,11 @@ bool ro_gui_wimp_read_eig_factors(os_mode mode, int *xeig, int *yeig) { * \param mode mode to use EIG factors for, or -1 for current */ void ro_convert_os_units_to_pixels(os_coord *os_units, os_mode mode) { - int xeig = 2, yeig = 2; + int xeig = 1, yeig = 1; ro_gui_wimp_read_eig_factors(mode, &xeig, &yeig); - os_units->x = (os_units->x >> xeig); - os_units->y = (os_units->y >> yeig); + os_units->x = ((os_units->x + (1 << xeig) - 1) >> xeig); + os_units->y = ((os_units->y + (1 << yeig) - 1) >> yeig); } @@ -128,7 +128,7 @@ void ro_convert_os_units_to_pixels(os_coord *os_units, os_mode mode) { * \param mode mode to use EIG factors for, or -1 for current */ void ro_convert_pixels_to_os_units(os_coord *pixels, os_mode mode) { - int xeig = 2, yeig = 2; + int xeig = 1, yeig = 1; ro_gui_wimp_read_eig_factors(mode, &xeig, &yeig); pixels->x = (pixels->x << xeig); -- cgit v1.2.3