fix: Image interaction skip behavior
PR fulfills these requirements
- [x] Best efforts were made to ensure docs/code are concise and coherent (checked for spelling/grammatical errors, commented out code, debug logs etc.)
- [x] Self-reviewed and ran all changes on a local instance (for bug fixes/features)
Change has impacts in these area(s)
(check all that apply)
- [ ] Product design
- [x] Frontend
What does this fix?
Bug was that drawing a polygon overlapping an existing one wasn't working properly. Even when pressing the 'ctrl' key to disable interactions, the existing polygon was getting selected/unselected at each click. This was because the 'skipInteraction' flag was set by the ctrl key, and then overwritten by the click (the Image model couldn't keep track if the interactions were to be skipped for multiple reasons at the same time).
With the fix, the Image model can keep track of multiple reasons for the interaction skip, therefore avoiding the flag to be overwritten.
In addition, I added the 'shouldSkipInteractions' in the polygon tool to skip interactions when we already started drawing a new polygon (preventing the need to hold the 'ctrl' key the whole time when drawing overlapping polygons).
Does this PR introduce a breaking change?
(check only one)
- [ ] Yes, and covered entirely by feature flag(s)
- [ ] Yes, and covered partially by feature flag(s)
- [x] No
- [ ] Not sure (briefly explain the situation below)