summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-02-14 14:48:56 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-02-14 14:48:56 +0000
commitfc7efc6e4a972c67adb8a1ada287ee3f064d6f1f (patch)
tree419c58959a021bf0de678cecf2dd15c8a77e4b69
parent5b4228f5aab532ce072deef432818165a214bf4d (diff)
downloadnetsurf-fc7efc6e4a972c67adb8a1ada287ee3f064d6f1f.tar.gz
netsurf-fc7efc6e4a972c67adb8a1ada287ee3f064d6f1f.tar.bz2
Don't use float maths for AUTO image sizing with one given dimension.
svn path=/trunk/netsurf/; revision=11677
-rw-r--r--render/layout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/render/layout.c b/render/layout.c
index 3daf35d04..9f2dc88e0 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -853,7 +853,7 @@ void layout_get_object_dimensions(struct box *box, int *width, int *height,
int intrinsic_height = content_get_height(box->object);
if (intrinsic_height != 0)
- *width = intrinsic_width * ((float)(*height)) /
+ *width = (*height * intrinsic_width) /
intrinsic_height;
else
*width = intrinsic_width;
@@ -863,7 +863,7 @@ void layout_get_object_dimensions(struct box *box, int *width, int *height,
int intrinsic_height = content_get_height(box->object);
if (intrinsic_width != 0)
- *height = intrinsic_height * ((float)(*width)) /
+ *height = (*width * intrinsic_height) /
intrinsic_width;
else
*height = intrinsic_height;