diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-08 20:53:00 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-08 20:53:00 +0400 |
commit | b16f24c944467f6e4a07bcbeeabe17f73dc98244 (patch) | |
tree | 1fe756feff91f5b6c8e9f4aacb4c68df74fa699c /source/blender/editors/space_view3d | |
parent | 589a73a43fd6d5f3e0e693117d91d150ca67de11 (diff) |
add delete key for removing active ruler.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_ruler.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_ruler.c b/source/blender/editors/space_view3d/view3d_ruler.c index 75cf27a6064..45e4a4efdb6 100644 --- a/source/blender/editors/space_view3d/view3d_ruler.c +++ b/source/blender/editors/space_view3d/view3d_ruler.c @@ -158,13 +158,11 @@ static RulerItem *ruler_item_add(RulerInfo *ruler_info) return ruler_item; } -#if 0 static void ruler_item_remove(RulerInfo *ruler_info, RulerItem *ruler_item) { BLI_remlink(&ruler_info->items, ruler_item); MEM_freeN(ruler_item); } -#endif static RulerItem *ruler_item_active_get(RulerInfo *ruler_info) { @@ -726,13 +724,26 @@ static int view3d_ruler_modal(bContext *C, wmOperator *op, wmEvent *event) } break; } - case ESCKEY: { do_draw = true; exit_code = OPERATOR_CANCELLED; break; } + case DELKEY: + { + if (event->val == KM_PRESS) { + if (ruler_info->state == RULER_STATE_NORMAL) { + RulerItem *ruler_item = ruler_item_active_get(ruler_info); + if (ruler_item) { + ruler_item_remove(ruler_info, ruler_item); + ruler_info->item_active = -1; + do_draw = true; + } + } + } + break; + } default: exit_code = OPERATOR_PASS_THROUGH; break; |