diff options
author | Rob Haarsma <phaseIV@zonnet.nl> | 2003-02-17 15:30:11 +0300 |
---|---|---|
committer | Rob Haarsma <phaseIV@zonnet.nl> | 2003-02-17 15:30:11 +0300 |
commit | 8ff3cfe8b0567b89beb8762f2ee935577def8944 (patch) | |
tree | 2e194f81330a3e803e907781f771a17dd20f1a1d /source/blender | |
parent | 3fc3a9473f680bc44c908d725f56fae39c3ce0d5 (diff) |
fixed mousewheel behaviour in editmode
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/src/editobject.c | 68 |
1 files changed, 66 insertions, 2 deletions
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 250ef0a3a48..ba5db29bd10 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -3686,6 +3686,64 @@ int my_clock(void) #define YROTLOCAL (YROT|ROTLOCAL) #define ZROTLOCAL (ZROT|ROTLOCAL) +void view_editmove(unsigned char event) +{ + /* Regular: Zoom in */ + /* Shift: Scroll up */ + /* Ctrl: Scroll right */ + /* Alt-Shift: Rotate up */ + /* Alt-Ctrl: Rotate right */ + + switch(event) { + case WHEELUPMOUSE: + + if( G.qual & LR_SHIFTKEY ) { + if( G.qual & LR_ALTKEY ) { + G.qual &= ~LR_SHIFTKEY; + persptoetsen(PAD2); + G.qual |= LR_SHIFTKEY; + } else { + persptoetsen(PAD2); + } + } else if( G.qual & LR_CTRLKEY ) { + if( G.qual & LR_ALTKEY ) { + G.qual &= ~LR_CTRLKEY; + persptoetsen(PAD4); + G.qual |= LR_CTRLKEY; + } else { + persptoetsen(PAD4); + } + } else if(U.uiflag & WHEELZOOMDIR) + persptoetsen(PADMINUS); + else + persptoetsen(PADPLUSKEY); + + break; + case WHEELDOWNMOUSE: + if( G.qual & LR_SHIFTKEY ) { + if( G.qual & LR_ALTKEY ) { + G.qual &= ~LR_SHIFTKEY; + persptoetsen(PAD8); + G.qual |= LR_SHIFTKEY; + } else { + persptoetsen(PAD8); + } + } else if( G.qual & LR_CTRLKEY ) { + if( G.qual & LR_ALTKEY ) { + G.qual &= ~LR_CTRLKEY; + persptoetsen(PAD6); + G.qual |= LR_CTRLKEY; + } else { + persptoetsen(PAD6); + } + } else if(U.uiflag & WHEELZOOMDIR) + persptoetsen(PADPLUSKEY); + else + persptoetsen(PADMINUS); + + break; + } +} void transform(int mode) /* 'g' 'G' 'r' 'R' 's' 'S' 't' or 'w' 'N' */ { short canceled = 0; @@ -4635,7 +4693,10 @@ void transform(int mode) /* 'g' 'G' 'r' 'R' 's' 'S' 't' or 'w' 'N' */ firsttime= 1; } else { - persptoetsen(PADPLUSKEY); + if(event == WHEELDOWNMOUSE) + view_editmove(event); + else + persptoetsen(PADPLUSKEY); firsttime= 1; } break; @@ -4647,7 +4708,10 @@ void transform(int mode) /* 'g' 'G' 'r' 'R' 's' 'S' 't' or 'w' 'N' */ firsttime= 1; } else { - persptoetsen(PADMINUS); + if(event == WHEELUPMOUSE) + view_editmove(event); + else + persptoetsen(PADMINUS); firsttime= 1; } break; |