diff options
Diffstat (limited to 'source/fitz/stext-device.c')
-rw-r--r-- | source/fitz/stext-device.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/fitz/stext-device.c b/source/fitz/stext-device.c index 0040e976..330ac7e2 100644 --- a/source/fitz/stext-device.c +++ b/source/fitz/stext-device.c @@ -659,7 +659,13 @@ fz_stext_close_device(fz_context *ctx, fz_device *dev) for (line = block->u.t.first_line; line; line = line->next) { for (ch = line->first_char; ch; ch = ch->next) - line->bbox = fz_union_rect(line->bbox, fz_rect_from_quad(ch->quad)); + { + fz_rect ch_box = fz_rect_from_quad(ch->quad); + if (ch == line->first_char) + line->bbox = ch_box; + else + line->bbox = fz_union_rect(line->bbox, ch_box); + } block->bbox = fz_union_rect(block->bbox, line->bbox); } } |