summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
Diffstat (limited to 'render')
-rw-r--r--render/layout.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/render/layout.c b/render/layout.c
index d6e47257b..ca22ca36f 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -2182,9 +2182,11 @@ bool layout_line(struct box *first, int *width, int *y,
/* If the current text has not been measured (i.e. its
* width was estimated after splitting), and it fits on
- * the line, measure it properly. */
+ * the line, measure it properly, so next box is placed
+ * correctly. */
if (b->text && (x + b->width < x1 - x0) &&
- !(b->flags & MEASURED)) {
+ !(b->flags & MEASURED) &&
+ b->next) {
font_func->font_width(&fstyle, b->text,
b->length, &b->width);
b->flags |= MEASURED;