summaryrefslogtreecommitdiff
path: root/source/html
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-10-25 16:44:11 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-10-26 18:46:43 +0200
commit51d070b625dd68ed129a7f5c1f4250f3b9033c22 (patch)
tree8b170cadd5ecb4027a4cd43a6e3bd027fd3aad10 /source/html
parent097e4ff75e88886533c23f46f777661dc79217a4 (diff)
downloadmupdf-51d070b625dd68ed129a7f5c1f4250f3b9033c22.tar.xz
epub: Fix link bbox when it contains spaces that have been justified.
Diffstat (limited to 'source/html')
-rw-r--r--source/html/html-layout.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/html/html-layout.c b/source/html/html-layout.c
index a0d188d9..54a96c1d 100644
--- a/source/html/html-layout.c
+++ b/source/html/html-layout.c
@@ -1904,7 +1904,7 @@ static fz_link *load_link_flow(fz_context *ctx, fz_html_flow *flow, fz_link *hea
fz_rect bbox;
fz_link_dest dest;
char *href;
- float w;
+ float end;
while (flow)
{
@@ -1913,20 +1913,20 @@ static fz_link *load_link_flow(fz_context *ctx, fz_html_flow *flow, fz_link *hea
if (href && (int)(flow->y / page_h) == page)
{
/* Coalesce contiguous flow boxes into one link node */
- w = flow->w;
+ end = flow->x + flow->w;
while (next &&
next->y == flow->y &&
next->h == flow->h &&
next->box->a_href &&
!strcmp(href, next->box->a_href))
{
- w += next->w;
+ end = next->x + next->w;
next = next->next;
}
bbox.x0 = flow->x;
bbox.y0 = flow->y - page * page_h;
- bbox.x1 = bbox.x0 + w;
+ bbox.x1 = end;
bbox.y1 = bbox.y0 + flow->h;
if (flow->type != FLOW_IMAGE)
{