diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-04 18:32:26 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-04 18:32:26 +0300 |
commit | f3201f08533ec8984339b0653f3587b1ca7ad05e (patch) | |
tree | f70eed5f9a0c38dfd1fd82308753c3fbcc901894 /source/blender/editors | |
parent | 0b6873a776552bd47c305ee1bc4e629a76da0037 (diff) |
UI: curve widget tweaks
* Make snap ctrl instead of shift
* Only enable snapping after moving a few pixels,
otherwise too easy to do enable this by accident.
* Deselecting points with shift did not work.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index e81c1a2f0a5..d2545e530e4 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -2990,6 +2990,16 @@ static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap, offsx= cumap->curr.xmin; offsy= cumap->curr.ymin; + if(snap) { + float d[2]; + + d[0]= mx - data->dragstartx; + d[1]= my - data->dragstarty; + + if(len_v2(d) < 3.0f) + snap= 0; + } + if(data->dragsel != -1) { int moved_point= 0; /* for ctrl grid, can't use orig coords because of sorting */ @@ -3126,10 +3136,13 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt if(sel!= -1) { /* ok, we move a point */ /* deselect all if this one is deselect. except if we hold shift */ - if(event->shift==0 && (cmp[sel].flag & SELECT)==0) + if(event->shift==0) { for(a=0; a<cuma->totpoint; a++) cmp[a].flag &= ~SELECT; - cmp[sel].flag |= SELECT; + cmp[sel].flag |= SELECT; + } + else + cmp[sel].flag ^= SELECT; } else { /* move the view */ @@ -3150,7 +3163,7 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt else if(data->state == BUTTON_STATE_NUM_EDITING) { if(event->type == MOUSEMOVE) { if(mx!=data->draglastx || my!=data->draglasty) { - if(ui_numedit_but_CURVE(but, data, event->shift, mx, my)) + if(ui_numedit_but_CURVE(but, data, event->ctrl, mx, my)) ui_numedit_apply(C, block, but, data); } } |