From 06e6ec4eb15ff8c3ae4e33243ed9aa2c06ac35d4 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 16 Feb 2011 17:14:47 +0000 Subject: If percentage is negative, resort to floating point. svn path=/trunk/netsurf/; revision=11700 --- render/layout.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'render') 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, -- cgit v1.2.3