* Change to the working of the left mouse select preference
Previously, the implementation of this was quite awkward, with the preference swapping mouse buttons globally, rather than just selection, as is advertised on the pref. This had the effect of changing the painting in sculpt/texture paint/weight paint/etc to the left mouse button. This was totally silly, since when using a tablet, left mouse select is the sane way to go, but it meant that every time you wanted to sculpt or paint, you had to switch the mouse buttons around so you could actually use the tablet as normal. This commit fixes that, and makes the preference do just what it says, use left mouse for selection (i.e. in object/edit mode) and only that.
This commit is contained in:
@@ -1131,7 +1131,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
Object *ob= OBACT; /* do not change! */
|
||||
float *curs;
|
||||
int doredraw= 0, pupval;
|
||||
unsigned short event= evt->event, origevent= evt->event;
|
||||
unsigned short event= evt->event;
|
||||
short val= evt->val;
|
||||
char ascii= evt->ascii;
|
||||
|
||||
@@ -1148,8 +1148,15 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
|
||||
/* swap mouse buttons based on user preference */
|
||||
if (U.flag & USER_LMOUSESELECT) {
|
||||
if (event==LEFTMOUSE) event = RIGHTMOUSE;
|
||||
else if (event==RIGHTMOUSE) event = LEFTMOUSE;
|
||||
/* only swap mouse button for selection, in modes where it is relevant.
|
||||
* painting/sculpting stays on LEFTMOUSE */
|
||||
if ( !((G.f & G_SCULPTMODE) || (G.f & G_WEIGHTPAINT) ||
|
||||
(G.f & G_VERTEXPAINT) || (G.f & G_TEXTUREPAINT)) ||
|
||||
(G.obedit) )
|
||||
{
|
||||
if (event==LEFTMOUSE) event = RIGHTMOUSE;
|
||||
else if (event==RIGHTMOUSE) event = LEFTMOUSE;
|
||||
}
|
||||
}
|
||||
|
||||
if(!mouse_in_header(sa)) {
|
||||
@@ -1538,7 +1545,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
vertex_paint();
|
||||
}
|
||||
else if (G.f & G_TEXTUREPAINT) {
|
||||
imagepaint_paint(origevent==LEFTMOUSE? L_MOUSE: R_MOUSE, 1);
|
||||
imagepaint_paint(L_MOUSE, 1);
|
||||
}
|
||||
break;
|
||||
case MIDDLEMOUSE:
|
||||
@@ -4739,7 +4746,7 @@ static void changeimagepace(ScrArea *sa, void *spacedata)
|
||||
static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
{
|
||||
SpaceImage *sima= spacedata;
|
||||
unsigned short event= evt->event, origevent= evt->event;
|
||||
unsigned short event= evt->event;
|
||||
short val= evt->val;
|
||||
|
||||
if(val==0) return;
|
||||
@@ -4761,10 +4768,10 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
scrarea_queue_winredraw(sa);
|
||||
break;
|
||||
case LEFTMOUSE:
|
||||
imagepaint_paint(origevent==LEFTMOUSE? L_MOUSE: R_MOUSE, 0);
|
||||
imagepaint_paint(L_MOUSE, 0);
|
||||
break;
|
||||
case RIGHTMOUSE:
|
||||
imagepaint_pick(origevent==LEFTMOUSE? L_MOUSE: R_MOUSE);
|
||||
imagepaint_pick(R_MOUSE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user