Bugfix #19923: UVImage editor gets stuck in move/zoom mode

This commit is contained in:
Joshua Leung 2009-11-20 10:21:31 +00:00
parent 3119eaf284
commit 088c6d6666
2 changed files with 10 additions and 0 deletions

@ -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;

@ -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;