diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2016-01-20 18:38:04 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2016-01-20 20:02:55 +0000 |
commit | 38e6fd1b74f2bc6677398d5167aff68bf163a286 (patch) | |
tree | c75024c0f3bd10617c440caf506bfe9c54dd335b | |
parent | 018adc2f5e332609dfbd71b4c29951dd80f9f67e (diff) | |
download | netsurf-38e6fd1b74f2bc6677398d5167aff68bf163a286.tar.gz netsurf-38e6fd1b74f2bc6677398d5167aff68bf163a286.tar.bz2 |
Split adding float to a container out into separate function.
-rw-r--r-- | render/layout.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/render/layout.c b/render/layout.c index 008be2426..4381f296c 100644 --- a/render/layout.c +++ b/render/layout.c @@ -2088,6 +2088,19 @@ void find_sides(struct box *fl, int y0, int y1, /** + * Insert a float into a container. + * + * \param cont block formatting context block, used to contain float + * \param b box to add to float + */ +static void add_float_to_container(struct box *cont, struct box *b) +{ + b->next_float = cont->float_children; + cont->float_children = b; +} + + +/** * Layout lines of text or inline boxes with floats. * * \param inline_container inline container box @@ -2787,16 +2800,7 @@ bool layout_line(struct box *first, int *width, int *y, else right = b; } - if (cont->float_children == b) { -#ifdef LAYOUT_DEBUG - LOG("float %p already placed", b); -#endif - - box_dump(stderr, cont, 0, true); - assert(0); - } - b->next_float = cont->float_children; - cont->float_children = b; + add_float_to_container(cont, b); split_box = 0; } |