Skip to content

Find sidebar, get_match_offset: ignore areas with center outside of match

Find sidebar implementation of evince uses "reconstruction" of found letters by comparing geometrical position of match and letters in get_match_offset method.

Before this change the only criteria for search was "beginning of the match is inside letter (area)". However, for pdfs containing letters that are much bigger than found (huge labels over content, like watermarks) those huge letters passed criteria and were incorrectly displayed in find sidebar.

With current architecture this problem can't be solved for 100% cases, but can be hugely improved. This diff adds extra check that center of a letter is inside the match. This fixes a huge percent of huge letters incorrectly passing criteria.

Merge request reports