diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-04-04 02:56:16 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-04-04 02:56:16 +0200 |
commit | 2522bc48349b23f5a22df7831171e73633f332f4 (patch) | |
tree | 89c324bac47afa10acdea200f130766fa3e4f0f7 /apps | |
parent | f0c292559fd1d484b0c71fb75d49f2c820234424 (diff) | |
download | mupdf-2522bc48349b23f5a22df7831171e73633f332f4.tar.xz |
apps: Correctly invert hits that span lines.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/pdfapp.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/apps/pdfapp.c b/apps/pdfapp.c index 8f5b3912..bebb8088 100644 --- a/apps/pdfapp.c +++ b/apps/pdfapp.c @@ -472,12 +472,14 @@ static inline fz_bbox bboxcharat(fz_textspan *span, int idx) void pdfapp_inverthit(pdfapp_t *app) { fz_bbox hitbox, bbox; + fz_matrix ctm; int i; if (app->hit < 0) return; hitbox = fz_emptybbox; + ctm = pdfapp_viewctm(app); for (i = app->hit; i < app->hit + app->hitlen; i++) { @@ -485,7 +487,7 @@ void pdfapp_inverthit(pdfapp_t *app) if (fz_isemptyrect(bbox)) { if (!fz_isemptyrect(hitbox)) - pdfapp_invert(app, hitbox); + pdfapp_invert(app, fz_transformbbox(ctm, hitbox)); hitbox = fz_emptybbox; } else @@ -495,14 +497,7 @@ void pdfapp_inverthit(pdfapp_t *app) } if (!fz_isemptyrect(hitbox)) - { - fz_matrix ctm; - - ctm = pdfapp_viewctm(app); - hitbox = fz_transformbbox(ctm, hitbox); - - pdfapp_invert(app, hitbox); - } + pdfapp_invert(app, fz_transformbbox(ctm, hitbox)); } static inline int charat(fz_textspan *span, int idx) |