diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-11-20 13:21:31 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-11-20 13:21:31 +0300 |
commit | 088c6d666671258adad2f23886f9af3fa2508645 (patch) | |
tree | 2d3b7f664decfd31c8e0f82448e45bac7dd21176 /source/blender | |
parent | 3119eaf2844e2e5f2be6da74ddd06f0fa0626f9e (diff) |
Bugfix #19923: UVImage editor gets stuck in move/zoom mode
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/view2d_ops.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 92d4c4271d8..6579e30900b 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -237,6 +237,7 @@ static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event) case LEFTMOUSE: case MIDDLEMOUSE: + case ESCKEY: if (event->val==KM_RELEASE) { /* calculate overall delta mouse-movement for redo */ RNA_int_set(op->ptr, "deltax", (vpd->startx - vpd->lastx)); @@ -253,6 +254,12 @@ static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } +static int view_pan_cancel(bContext *C, wmOperator *op) +{ + view_pan_exit(C, op); + return OPERATOR_CANCELLED; +} + void VIEW2D_OT_pan(wmOperatorType *ot) { /* identifiers */ @@ -264,6 +271,7 @@ void VIEW2D_OT_pan(wmOperatorType *ot) ot->exec= view_pan_exec; ot->invoke= view_pan_invoke; ot->modal= view_pan_modal; + ot->cancel= view_pan_cancel; /* operator is repeatable */ ot->flag= OPTYPE_BLOCKING; diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 9ef7a4d9ae4..897b02404ef 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -234,6 +234,7 @@ static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event) view_pan_exec(C, op); break; case MIDDLEMOUSE: + case LEFTMOUSE: if(event->val==KM_RELEASE) { view_pan_exit(C, op, 0); return OPERATOR_FINISHED; @@ -349,6 +350,7 @@ static int view_zoom_modal(bContext *C, wmOperator *op, wmEvent *event) ED_area_tag_redraw(CTX_wm_area(C)); break; case MIDDLEMOUSE: + case LEFTMOUSE: if(event->val==KM_RELEASE) { view_zoom_exit(C, op, 0); return OPERATOR_FINISHED; |