From 1f787e13a6c75cf12a09fc44d590ba9169c52a71 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 26 Jun 2018 14:45:15 +0200 Subject: Add fz_snap_selection function to snap selection to chars/words/lines. Updates the input point coordinates, and also returns a quad with appropriate UI handles. --- include/mupdf/fitz/structured-text.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/mupdf/fitz/structured-text.h b/include/mupdf/fitz/structured-text.h index 44219f4d..2adfa73a 100644 --- a/include/mupdf/fitz/structured-text.h +++ b/include/mupdf/fitz/structured-text.h @@ -152,6 +152,15 @@ int fz_search_stext_page(fz_context *ctx, fz_stext_page *text, const char *needl */ int fz_highlight_selection(fz_context *ctx, fz_stext_page *page, fz_point a, fz_point b, fz_quad *quads, int max_quads); +enum +{ + FZ_SELECT_CHARS, + FZ_SELECT_WORDS, + FZ_SELECT_LINES, +}; + +fz_quad fz_snap_selection(fz_context *ctx, fz_stext_page *page, fz_point *ap, fz_point *bp, int mode); + /* fz_copy_selection: Return a newly allocated UTF-8 string with the text for a given selection. -- cgit v1.2.3