GNOME Bugzilla – Bug 769133
Better hover for highlight annotations
Last modified: 2018-05-22 16:43:58 UTC
Using just the rectangle to hover a highlight annotation is not good. For instance, it is easy to have two highlight annotations with rectangles that overlap. Currently we cannot detect this... These patches fix that. These are rebased from Giselle's work.
Created attachment 332048 [details] [review] document: ev_mapping_list_get_all Implements a function that returns all EvMappings at a certain point. Needed for annotations (especially text markups), whose bounding boxes might overlap.
Created attachment 332049 [details] [review] libdocument, pdf: adding method is_xy_in_annotation Added the method is_xy_in_annotation to the interface of document-annotations. It intends to check if a point (x,y) is inside the annotation's quadrilaterals (and not its bounding box, which can be checked using the EvMapping). Also implements the function in the pdf back-end.
Created attachment 332050 [details] [review] libview: checking if point is inside annotation Added a step to check if a point is inside an annotation. In case it is foud to be inside the bounding box, view asks the document if it is actually inside the annotations, since the quadrilaterals might not comprise the whole are of the bounding box. Only then it become selectable.
Review of attachment 332048 [details] [review]: ::: libdocument/ev-mapping-list.c @@ +141,3 @@ + * Returns: (transfer none): a #GArray of all the #EvMapping in the list at coordinates (x, y) + * + * Since: 3.14 I think we need to update this one.
Nice work. It is very convenient. Without this patches it was kind of hard (annoying to be honest :-) to select the text next to the annotation because it was within the rectangle.
Carlos, what do you think?
The patch seems to be incomplete as it doesn't seem to fix Bug 787070 while the problems sound similar.
The problems are unrelated :) Nevertheless, I will update the patches so Carlos can review up to date patches.
Yeah, I just figured out what your patch does exactly. As your and my patch are both fielding with the selection process anyway: What do you think about moving the get_annotation_mapping_at_location stuff in the poppler backend instead of adding is_xy_in_annotation to the EvDocumentAnnotationsInterface? Isn't the selection process of an annotation strongly coupled to the file-format? (just a thought, feel free to ignore it ;) )
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/evince/issues/696.