multi(gestures): add `keyTriggerClickRotate` gesture, fix `keyTriggerDragRotate` gesture
Issues:
(2) Cursor keyboard rotation also no longer sets rotation to the angle of cursor immediately when clicking.
https://github.com/fleaflet/flutter_map/assets/58115698/74cc4727-7a31-49c7-8617-b5ecf21a9c35
(1) One bug with cursor keyboard rotation. Rotation is not tracking the cursor properly. I remember having a similar issue when implementing the algorithm initially. Maybe double checking that nothing in the implementaiton itself has changed, and every variable is being changed/reset at the correct points.
- This pr adds the
keyTriggerClickRotategesture to the gesture rewrite. - The gesture takes slightly longer to execute than on master to filter out drag gestures while the CTRL/specified key is pressed.
- The rotation should be animated, added this as an idea to https://github.com/fleaflet/flutter_map/issues/1748.
The gesture takes slightly longer to execute than on master to filter out drag gestures while the CTRL/specified key is pressed.
Can you elaborate here? If the trigger key is held, there should be no other gestures or onTap/onDoubleTaps captured, and therefore no delay.
Not sure if I should call this a feature or a limitation of the new implementation...
One of the biggest goals of the gesture rewrite was to be as high level as possible to avoid any potential platform specific bugs.
Because we are using the GestureDetector to listen for every gesture input it supports and GestureDetector has delays some callbacks until they are semi-verified or verified we have a slight delay here (the known double tap delay).
We could disable the double tap callbacks while the triggerKey is pressed, however this would require an additional widget rebuild. Additionally we would need a on-trigger-key-release callback that could lead to problems if the targeted windows switches before the key gets released.
While the delay is noticable at the moment I think it's not that bad once the rotation is animated. I think I've seen such delays for commerical maps as well if I'm not wrong 🤔
What do you think? Do you want to have some workaround code to have no delay at all?
Added the keyTriggerDragRotate gesture fix to this pr because both are quite similar.