UV paint tool did not work with swapped mouse buttons in user prefs.
This commit is contained in:
2005-09-12 19:20:53 +00:00
parent 16b146d516
commit c27799910f
3 changed files with 14 additions and 9 deletions

View File

@@ -3759,23 +3759,28 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
float uv_prev[2], uv_curr[2];
extern VPaint Gvp;
#endif /* NAN_TPT */
short mousebut = L_MOUSE;
short paintmousebut;
if(val==0) return;
if(uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0;
/* swap mouse buttons based on user preference */
if (event == LEFTMOUSE) {
paintmousebut = L_MOUSE;
} else if (event == RIGHTMOUSE) {
paintmousebut = R_MOUSE;
}
if (U.flag & USER_LMOUSESELECT) {
if (event == LEFTMOUSE) {
event = RIGHTMOUSE;
mousebut = R_MOUSE;
} else if (event == RIGHTMOUSE) {
event = LEFTMOUSE;
mousebut = L_MOUSE;
}
}
if (sima->flag & SI_DRAWTOOL) {
switch(event) {
case CKEY:
@@ -3783,7 +3788,7 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
scrarea_queue_winredraw(curarea);
break;
default:
UVTexturePaintMsg(spacedata,event,val);
UVTexturePaintMsg(spacedata,event,val,paintmousebut);
}
}