diff options
author | Ton Roosendaal <ton@blender.org> | 2005-05-01 01:19:19 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-05-01 01:19:19 +0400 |
commit | 42ae9128fab8e6ec294c16cb2ce4eedcde9c4aed (patch) | |
tree | 0cea2bec50b4065cbe590aebf9abe9b0268dc81e /source/blender/src/transform.c | |
parent | 413677cafffd797524bb1ac5dd2ec42957a56a30 (diff) |
Removal of old transform() <sob> part one.
- added in new transform the (not so useful but yah) old feature that
does scrollwheel zoom during transform
- had to change transform call arguments for uv-window/sequence/oops to
match new transform for mouse callback
TODO (for martin?)
- pulldown menu support to call with local axes compliant as for pressing
it with hotkey
- mirrormenu() still uses old transform stuff...
Diffstat (limited to 'source/blender/src/transform.c')
-rwxr-xr-x | source/blender/src/transform.c | 67 |
1 files changed, 65 insertions, 2 deletions
diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index 2c0ee40954c..3c6de26b7d6 100755 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -80,6 +80,7 @@ #include "BIF_editmesh.h" #include "BIF_screen.h" #include "BIF_space.h" +#include "BIF_toets.h" #include "BIF_toolbox.h" #include "BKE_action.h" @@ -128,6 +129,66 @@ int LastMode = TFM_TRANSLATION; /* ************************** TRANSFORMATIONS **************************** */ +static void view_editmove(unsigned short 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 & USER_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 & USER_WHEELZOOMDIR) + persptoetsen(PADPLUSKEY); + else + persptoetsen(PADMINUS); + + break; + } +} + + void Transform(int mode, int context) { int ret_val = 0; @@ -426,16 +487,18 @@ void Transform(int mode, int context) if(Trans.flag & T_PROP_EDIT) { Trans.propsize*= 1.1f; calculatePropRatio(&Trans); - Trans.redraw= 1; } + else view_editmove(event); + Trans.redraw= 1; break; case WHEELUPMOUSE: case PADMINUS: if(Trans.flag & T_PROP_EDIT) { Trans.propsize*= 0.90909090f; calculatePropRatio(&Trans); - Trans.redraw= 1; } + else view_editmove(event); + Trans.redraw= 1; break; } Trans.redraw |= handleNumInput(&(Trans.num), event); |