diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-03-07 12:18:26 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-03-07 12:19:15 +0100 |
commit | 4614c7472c7eb43bde8ffbbcf37e207e4c83a143 (patch) | |
tree | fb91ffe95d442c9fe3ab4e9af16f74a1d0135dc9 | |
parent | 17d4efed6a9140d072e7e497132b96dd37f73eca (diff) | |
download | mupdf-4614c7472c7eb43bde8ffbbcf37e207e4c83a143.tar.xz |
Fix 699081: Missing coordinate transformation when copying text.
-rw-r--r-- | platform/x11/pdfapp.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c index f038f945..d5f70a29 100644 --- a/platform/x11/pdfapp.c +++ b/platform/x11/pdfapp.c @@ -1923,13 +1923,12 @@ void pdfapp_oncopy(pdfapp_t *app, unsigned short *ucsbuf, int ucslen) fz_stext_block *block; fz_stext_line *line; fz_stext_char *ch; - - int x0 = app->selr.x0; - int x1 = app->selr.x1; - int y0 = app->selr.y0; - int y1 = app->selr.y1; + fz_rect sel; pdfapp_viewctm(&ctm, app); + fz_invert_matrix(&ctm, &ctm); + sel = app->selr; + fz_transform_rect(&sel, &ctm); p = 0; need_newline = 0; @@ -1947,7 +1946,7 @@ void pdfapp_oncopy(pdfapp_t *app, unsigned short *ucsbuf, int ucslen) int c = ch->c; if (c < 32) c = 0xFFFD; - if (ch->bbox.x1 >= x0 && ch->bbox.x0 <= x1 && ch->bbox.y1 >= y0 && ch->bbox.y0 <= y1) + if (ch->bbox.x1 >= sel.x0 && ch->bbox.x0 <= sel.x1 && ch->bbox.y1 >= sel.y0 && ch->bbox.y0 <= sel.y1) { saw_text = 1; if (need_newline) |