zotero / zotero-ios

Zotero for iOS
https://apps.apple.com/us/app/zotero/id1513554812
Other
234 stars 30 forks source link

Avoid overlapping highlighting with tighter line spacing #984

Closed dstillman closed 3 months ago

dstillman commented 3 months ago

https://forums.zotero.org/discussion/comment/468295/#Comment_468295

I assume this is an issue for PSPDFKit, but the desktop one seems arguably more correct.

mvasilak commented 3 months ago

Indeed these are the selection/highlight rects provided by PSPDFKit, we can transform them if we wish, according to some simple overlap detection logic. We can ask PSPDFKit support first, just in case they have a better suggestion. @mrtcode you mention some normalizing logic in the desktop client, can you please point to the relevant code?

mrtcode commented 3 months ago

Sure.

https://github.com/zotero/pdf.js/blob/449f8ddf0d668323dcb49a63011d7037ba5432d7/src/core/evaluator.js#L2982-L3005