diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2011-02-16 17:14:47 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2011-02-16 17:14:47 +0000 |
commit | 06e6ec4eb15ff8c3ae4e33243ed9aa2c06ac35d4 (patch) | |
tree | bda639f105d8a240b4cbf90449c119c52e41fd9c | |
parent | 8912285839a76db57204e7d14d131a4d13b4d53c (diff) | |
download | netsurf-06e6ec4eb15ff8c3ae4e33243ed9aa2c06ac35d4.tar.gz netsurf-06e6ec4eb15ff8c3ae4e33243ed9aa2c06ac35d4.tar.bz2 |
If percentage is negative, resort to floating point.
svn path=/trunk/netsurf/; revision=11700
-rw-r--r-- | render/layout.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/render/layout.c b/render/layout.c index 372899856..fc0f22b98 100644 --- a/render/layout.c +++ b/render/layout.c @@ -59,7 +59,9 @@ #define AUTO INT_MIN /* Fixed point value percentage of an integer, to an integer */ -#define FPCT_OF_INT_TOINT(a, b) FIXTOINT(FDIVI(FMULI(a, b), 100)) +#define FPCT_OF_INT_TOINT(a, b) (a < 0) ? \ + (FIXTOFLT(a) * b) / 100 : \ + FIXTOINT(FDIVI(FMULI(a, b), 100)) static bool layout_block_context(struct box *block, int viewport_height, |