Fix T40549: box selection starting point in the file requester.

We need to 'reset' mouse coordinates to the one it was when the gesture handling started,
else org coords are where the tweak event is created, which gives a noticeable gap
(several pixels) and unwanted behavior like the one retported about file box selection.
This commit is contained in:
Bastien Montagne 2014-06-09 15:31:27 +02:00
parent 0ae8ce3ab1
commit f1f33ba7be
Notes: blender-bot 2023-02-14 10:31:49 +01:00
Referenced by issue #40549, box selection starting point in the file requester
1 changed files with 3 additions and 0 deletions

View File

@ -3241,6 +3241,9 @@ static void tweak_gesture_modal(bContext *C, const wmEvent *event)
wmEvent tevent;
wm_event_init_from_window(window, &tevent);
/* We want to get coord from start of drag, not from point where it becomes a tweak event, see T40549 */
tevent.x = rect->xmin + sx;
tevent.y = rect->ymin + sy;
if (gesture->event_type == LEFTMOUSE)
tevent.type = EVT_TWEAK_L;
else if (gesture->event_type == RIGHTMOUSE)