GestureDetector: Make two_finger pans & swipes report the same sort of data than their standard brethren#10649
Conversation
|
Hmm, tweaking the hit-detection is probably as simple a tweaking GestureRange's Sooo, it's probably still cleaner to leave the nastiness inside GestureDetector, and let everyhting else be happy in the fact that |
|
|
NiLuJe
left a comment
There was a problem hiding this comment.
Reviewed 1 of 2 files at r1, 1 of 1 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)
|
Can you please keep the dispatcher unchanged for a while, to avoid conflicts with #10646. |
|
Oops, thought it was in an unmodified chunk ;). |
NiLuJe
left a comment
There was a problem hiding this comment.
Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)
|
Dispatcher is ready to get gesture |
…f data than their standard brethren (koreader#10649) Namely, that swipes report the gesture's *starting* coordinates as `pos` (for hit-detection purposes), while pans (and basically everything else) use the *lift* coordinates (as well as provide a relative vector). In each case, we now also provide a separate `start_pos`/`end_pos`, in case handlers need finer-grained data (e.g., anchoring UI elements to a swipe's lift coordinates).
In the process of looking over the "swipe reports the contact point (i.e., gesture start) as
poswhile pretty much everything else reports the lift point (i.e., gesture end)" for the QuickMenu anchoring thingy, I realized that the two-finger variants of the pans & swipes were doing things... differently (by always using the "swipe" semantics, which effectively means that two_finger_pan reports completely different things than pan).So, I started looking into best to handle that, and I came up with an ugly mess.
Which leads me to a simple question: why? Wouldn't it be much, much simpler is swipes just behaved like everything else and reported the lift point as
pos?I don't think we actually care about it much... unless it's used for the tap/gesture zone hit detection, in which case it makes sense to use the start position, dammit (yes, I just thought about that right now :D).
Anyway, RFC, I haven't even started testing this anyway ;D.
This change is