Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot select an annotation inside another annotation #175

Open
RahelaPogacean opened this issue Jul 12, 2023 · 11 comments
Open

Cannot select an annotation inside another annotation #175

RahelaPogacean opened this issue Jul 12, 2023 · 11 comments

Comments

@RahelaPogacean
Copy link

Hello!

I am using Annotorius with OpenSeadragon in my Angular application and I encountered the following issue: if I create an annotation inside another one, I am not able to select the inner annotation. The problem comes when I create the bigger annotation firstly and after that, the smaller/inner one. When I firstly create the smaller annotation and after that, the bigger one, both annotations are perfectly selected.

Any ideas how to manage to select both annotations in all situations?

@DiegoPino
Copy link

@RahelaPogacean hi. I'm using an older version in production (2.5.16) and don't have that issue. Tested interactively any combination and I get to select all of them independently of the order, so I have a few questions:

  • In that case where you can't select the inner one, you still get the highlight (on hover) the smaller one? or just the larger one highlights?

I have not overly tested the newer code (I really love when a piece of code/version works for us, and kinda stick with it, sorry!) but I would suggest:

  • Test with that older version and see if you still have the issue. If yes, then there might be an issue (guess, really a moonshot, can't proof nor blame anyone) related to this recent code/issue related to single click zoom, here:

d2ad213#diff-bf33addc32978ffda1071f72299d6302476ce1ee1c6e0032adde06654454cfd1R283-R284

My brain tells me (incorrectly sometimes) that preventing a default (which might allow another event listener to delegate? who knows right)? might interfere in some ways. But that said, if the issue is not the code itself, debugging that part of the code I pointed might help you see who/when/why your inner annotation is not selected

Sorry for not being of more help

@RahelaPogacean
Copy link
Author

@DiegoPino thank you for your response! When hovering over the inner annotation, it is not highlighted. And I also tried with your version and the selection is not working on the case I presented. I forgot to mention that the inner annotation is not selected for freeform and better polygon annotations.

@DiegoPino
Copy link

@RahelaPogacean ok, that helps! I will check with polygons. Maybe the bounding box for those is not calculated in the same way. Might take me a few hours (busy day)

@RahelaPogacean
Copy link
Author

@DiegoPino thank you, I am waiting for your response

@DiegoPino
Copy link

Hi, sorry for the delay here. I really can't reproduce the issue you are having.
See attached recording

Screen.Recording.2023-07-31.at.10.02.45.AM.mp4

Anything that you have customized (CSS/ other DOM elements on top?, custom plugins)? that you could share/could help me, at least, to reproduce the error?

@RahelaPogacean
Copy link
Author

@DiegoPino This is the way I create and select annotations. As you can see, the second scenario doesn't work, Here there are also the styles that I use in my application, which are still work in progress. Thank you and waiting for your feedback.

Annotation_selection.mp4

styles.txt

@rsimon
Copy link
Member

rsimon commented Aug 1, 2023

Thanks for posting this. Looks like it might be related to the freehand tool then. Annotorious sorts annotations by size, in order to ensure that the smallest is always on top. My guess is that something's wrong with the area calculation code in the freehand plugin, which would then cause that behavior.

@RahelaPogacean
Copy link
Author

@rsimon This is also reproducing for better polygon.

@rsimon
Copy link
Member

rsimon commented Aug 1, 2023

Hm. Well that's weird then. Polygon area computation is definitely working. Do you have any errors on the console? If anything breaks e.g. in your "onSelectionCreated" or "onAnnotationCreated" handlers, this would stop further execution and could cause Annotorious to not run the sorting.

@RahelaPogacean
Copy link
Author

I don't have any errors

@DiegoPino
Copy link

@RahelaPogacean any chance you can share your WIP code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants