diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2005-04-12 19:09:09 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2005-04-12 19:09:09 +0000 |
commit | e08d9e7263fe23168d68b532f07403282e18d3c4 (patch) | |
tree | a926244ea7db025aea6223a4cc99653cbde4897b | |
parent | 06a521f608744a2293a860f6b1a1f2b8c3243aa6 (diff) | |
download | netsurf-e08d9e7263fe23168d68b532f07403282e18d3c4.tar.gz netsurf-e08d9e7263fe23168d68b532f07403282e18d3c4.tar.bz2 |
[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
-rw-r--r-- | riscos/wimp.c | 8 |
1 files changed, 4 insertions, 4 deletions
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); |