diff options
author | James Bursa <james@netsurf-browser.org> | 2006-01-15 22:25:40 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2006-01-15 22:25:40 +0000 |
commit | e8ef816111d029870b530b417641e2331f8c4f6b (patch) | |
tree | 8af902cde1173af77979f4a49d99980a8e0cc28b /render/layout.c | |
parent | 5d6c56582875873eca1da05a530e397c95c7ab33 (diff) | |
download | netsurf-e8ef816111d029870b530b417641e2331f8c4f6b.tar.gz netsurf-e8ef816111d029870b530b417641e2331f8c4f6b.tar.bz2 |
[project @ 2006-01-15 22:25:40 by bursa]
Fix crash related to negative margins on inlines.
svn path=/import/netsurf/; revision=2021
Diffstat (limited to 'render/layout.c')
-rw-r--r-- | render/layout.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/render/layout.c b/render/layout.c index a607261fd..7df848f0a 100644 --- a/render/layout.c +++ b/render/layout.c @@ -3,7 +3,7 @@ * Licensed under the GNU General Public License, * http://www.opensource.org/licenses/gpl-license * Copyright 2005 Richard Wilson <info@tinct.net> - * Copyright 2005 James Bursa <bursa@users.sourceforge.net> + * Copyright 2006 James Bursa <bursa@users.sourceforge.net> * Copyright 2003 Phil Mellor <monkeyson@users.sourceforge.net> */ @@ -1095,12 +1095,17 @@ bool layout_line(struct box *first, int width, int *y, for (i = 0; i != 4; i++) if (b->margin[i] == AUTO) b->margin[i] = 0; + x += b->margin[LEFT] + b->border[LEFT] + + b->padding[LEFT]; if (b->inline_end) { b->inline_end->margin[RIGHT] = b->margin[RIGHT]; b->inline_end->padding[RIGHT] = b->padding[RIGHT]; b->inline_end->border[RIGHT] = b->border[RIGHT]; + } else { + x += b->padding[RIGHT] + b->border[RIGHT] + + b->margin[RIGHT]; } } else if (b->type == BOX_INLINE_END) { b->width = 0; @@ -1110,6 +1115,8 @@ bool layout_line(struct box *first, int width, int *y, } else { space_after = 0; } + x += b->padding[RIGHT] + b->border[RIGHT] + + b->margin[RIGHT]; continue; } |