[#21523] Drag Immediately only working when "Select With" is set to LMB
authorMartin Poirier <theeth@yahoo.com>
Sun, 14 Mar 2010 18:58:14 +0000 (18:58 +0000)
committerMartin Poirier <theeth@yahoo.com>
Sun, 14 Mar 2010 18:58:14 +0000 (18:58 +0000)
Partial fix. Check lauch event if left or right mouse.

Also added a bug fix for manipulator (sometimes, type = 0)

source/blender/editors/transform/transform.c

index b394461..7d8ee67 100644 (file)
@@ -1046,7 +1046,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
 
                /* confirm transform if launch key is released after mouse move */
                /* XXX Keyrepeat bug in Xorg fucks this up, will test when fixed */
-               if (event->type == LEFTMOUSE /*t->launch_event*/ && t->state != TRANS_STARTING)
+               if (event->type == t->launch_event && (t->launch_event == LEFTMOUSE || t->launch_event == RIGHTMOUSE) && t->state != TRANS_STARTING)
                {
                        t->state = TRANS_CONFIRM;
                }
@@ -1456,6 +1456,22 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
 
        t->launch_event = event ? event->type : -1;
 
+       if (t->launch_event == EVT_TWEAK_R)
+       {
+               t->launch_event = RIGHTMOUSE;
+       }
+       else if (t->launch_event == EVT_TWEAK_L)
+       {
+               t->launch_event = LEFTMOUSE;
+       }
+       // XXX Remove this when wm_operator_call_internal doesn't use window->eventstate (which can have type = 0)
+       // For manipulator only, so assume LEFTMOUSE
+       else if (t->launch_event == 0)
+       {
+               t->launch_event = LEFTMOUSE;
+       }
+
+
        if (!initTransInfo(C, t, op, event))                                    // internal data, mouse, vectors
        {
                return 0;