diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-07-11 14:24:19 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-08-10 14:09:46 +0200 |
commit | 84c0c62018110e0cbb01d30d4df96b64e0b6899f (patch) | |
tree | eb5fa87e5fce4b7897e68e640302325bd6b20ee7 /platform/gl | |
parent | 37ed199fcebc73954e694b44033aeca4ab8a417f (diff) | |
download | mupdf-84c0c62018110e0cbb01d30d4df96b64e0b6899f.tar.xz |
Respect NoRotate flag for icon-based annotations.
Diffstat (limited to 'platform/gl')
-rw-r--r-- | platform/gl/gl-annotate.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/platform/gl/gl-annotate.c b/platform/gl/gl-annotate.c index aa40cc51..265ab673 100644 --- a/platform/gl/gl-annotate.c +++ b/platform/gl/gl-annotate.c @@ -115,6 +115,8 @@ static void new_annot(int type) case PDF_ANNOT_SOUND: { fz_rect icon_rect = { 12, 12, 12+20, 12+20 }; + pdf_set_annot_flags(ctx, selected_annot, + PDF_ANNOT_IS_PRINT | PDF_ANNOT_IS_NO_ZOOM | PDF_ANNOT_IS_NO_ROTATE); pdf_set_annot_rect(ctx, selected_annot, icon_rect); pdf_set_annot_color(ctx, selected_annot, 3, yellow); } @@ -721,10 +723,14 @@ static void do_edit_icon(fz_irect canvas_area, fz_irect area, fz_rect *rect) /* Commit movement on mouse-up */ if (!ui.down) { + fz_point dp = { rect->x0 - start_pt.x, rect->y0 - start_pt.y }; moving = 0; - if (fz_abs(start_pt.x - rect->x0) > 0.1f || fz_abs(start_pt.x - rect->y0) > 0.1f) + if (fz_abs(dp.x) > 0.1f || fz_abs(dp.y) > 0.1f) { - fz_rect trect = fz_transform_rect(*rect, view_page_inv_ctm); + fz_rect trect = pdf_annot_rect(ctx, selected_annot); + dp = fz_transform_vector(dp, view_page_inv_ctm); + trect.x0 += dp.x; trect.x1 += dp.x; + trect.y0 += dp.y; trect.y1 += dp.y; pdf_set_annot_rect(ctx, selected_annot, trect); } } |