Skip to content

markup annotations: use markup text region

Nelson Ben requested to merge BUG_markup_annots_check_quadrilaterals into master

when determining if the mouse pointer is over a markup annotation (used by evince to change the pointer type). This is more accurate than just using the annot area.

Implemented as a new libdocument method interface that we pass it the 'annotation' and 'x,y' coords and returns us whether that location is over the actual markup text of the annotation. The poppler implementation works by checking if there's any quadrilateral under that location.

For pdf, quadrilaterals represent a more precise shape of the annotation than just the annotation area (which is currently used) so by checking the quads region we avoid false positives when hovering over blank space.

The "point over a quadrilateral" code is based on:
Algorithm: https://math.stackexchange.com/a/190203 Implementation: https://stackoverflow.com/a/37865332

Fixes issue #1275 (closed)

Edited by Nelson Ben

Merge request reports