Closed Architrixs closed 2 years ago
That doesn't quite work yet. The purpose of this check is the following:
mousemove
event.mouseover
would also trigger in cases where the actual shape isn't underneath the mouse. See examples below:Your test for the line always returns true
, which means a line will always obstruct any shape underneath it's bounding box. The ideal test would check if the mouse is actually above the line (with a small buffer on each side).
I'll merge the PR for now, so that things work. But I'll open an issue so we can keep this limitation on the list.
Got
That doesn't quite work yet. The purpose of this check is the following:
- All shapes are stored in a spatial index, using their bounding box. This way, Annotorious can quickly test which shapes are underneath the mouse for every
mousemove
event.- The spatial index will only test by the shape bounding box. Therefore, a
mouseover
would also trigger in cases where the actual shape isn't underneath the mouse. See examples below:
- The spatial index will return a hit anywhere within the dashed box. That's where the second test comes in: this takes all the shapes found by bounding box, and tests whether they actually intersect the mouse coordinates.
Your test for the line always returns
true
, which means a line will always obstruct any shape underneath it's bounding box. The ideal test would check if the mouse is actually above the line (with a small buffer on each side).I'll merge the PR for now, so that things work. But I'll open an issue so we can keep this limitation on the list.
Got it! Thanks.
Corresponding issue ticket here: https://github.com/recogito/annotorious-openseadragon/issues/132
Related change for https://github.com/recogito/annotorious-selector-pack/pull/17