-
Notifications
You must be signed in to change notification settings - Fork 284
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
Direction of drag for selecting multiple images #327
Comments
That's odd. The bounds code seems to be direction invariant here: Leaflet.DistortableImage/src/DistortableCollection.js Lines 167 to 183 in 10a78c5
Wonder what's up. |
I think it may have something to do with flipping axis or something else very hard to debug 🙄I will check it out right now and see if I can work around it by flipping the axis myself and checking again |
@jywarren you can drag from any direction, but you must make the area a lot larger to do this from any direction other than bottom-left: |
I think it has to do with this line:
and this: |
Hm, i'm getting some odd behaviors on dragging for big maps on MapKnitter.
After zooming around a bit it seems maybe the calculations are offset? I
can try to make a GIF soon!
…On Sat, Jul 6, 2019 at 6:21 PM Sasha Boginsky ***@***.***> wrote:
I think it has to do with this line:
https://github.com/publiclab/Leaflet.DistortableImage/blob/10a78c572dc1a1499555d75b3bf661cc4cddd476/src/edit/BoxSelector.js#L83
and this:
https://github.com/Leaflet/Leaflet/pull/5204/files
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#327?email_source=notifications&email_token=AAAF6JZHHPY3JFRTKJ7YG6LP6ELDLA5CNFSM4H6M5C3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZLBFFY#issuecomment-508957335>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAF6J22ATC4KHHLN3WZLIDP6ELDLANCNFSM4H6M5C3A>
.
|
@jywarren ah! Seeing that too now. It seems to happen at closer zoom levels. I will double check the calculations for these zoom levels now. It is either that or deselection is being triggered right after selection, which was the original reason why the image could only be selected from "bottom - right". These offsets get pretty confusing - it would be nice if we could try to write a wiki outlining which methods (project, point, ltlng, containerPointToLatLng, etc.) to use when for future contributors! |
Point 1: you must not release shift-key until after you release drag or deselection will fire. is this ok? The other alternative was to make deselection happen on mousedown on the map instead, but I didn't like how that looked as much in action |
Point 2: the bug seems to reproduce for me when I zoom in a lot and zoom out. Once it appears it does not go away under any zoom until a page refresh. Confirming the bug is due to the bounds not being properly read, and not an event handling issue. |
@jywarren ok I did a bunch of runs and the behavior I am seeing is that the bug actually occurs after panning the map left or right (which would make sense with the idea of a lng mismatch) and does not have to do with zoom. We just tend to need to pan when we zoom. |
I believe its fixed now! adding tests. Might also start this wiki page starting with normalizing after a pan |
Hi! I'm really enjoying the multiple image select in the latest release. I noticed that I seem to be able to select only by dragging from lower-right to upper-left, but no other direction (i.e. not from NE>SW or SW>NE or NW>SE). I was wondering if we could adapt the selection math to address this?
Potentially related to #29 and #244 -- thanks!
The text was updated successfully, but these errors were encountered: