mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-24 04:56:50 +03:00
[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
This commit is contained in:
parent
06a521f608
commit
e08d9e7263
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user