commit from joe 26206, removed timer from zoom. this is needed for continuous zoom.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 6 Feb 2010 12:44:37 +0000 (12:44 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 6 Feb 2010 12:44:37 +0000 (12:44 +0000)
source/blender/editors/space_view3d/view3d_edit.c

index bd7b2d3c5b8ed4bf2448c304ba7acf9e5195d3ff..1658e0288fbb734063857da7a783c741c56aafae 100644 (file)
@@ -1076,7 +1076,11 @@ static int viewzoom_modal(bContext *C, wmOperator *op, wmEvent *event)
        short event_code= VIEW_PASS;
 
        /* execute the events */
-       if(event->type==MOUSEMOVE) {
+       if (event->type == TIMER && event->customdata == vod->timer) {
+               /* continuous zoom */
+               event_code= VIEW_APPLY;
+       }
+       else if(event->type==MOUSEMOVE) {
                event_code= VIEW_APPLY;
        }
        else if(event->type==EVT_MODAL_MAP) {
@@ -1194,6 +1198,12 @@ static int viewzoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
                        return OPERATOR_FINISHED;
                }
                else {
+                       if(U.viewzoom == USER_ZOOM_CONT) {
+                               /* needs a timer to continue redrawing */
+                               vod->timer= WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.01f);
+                               vod->timer_lastdraw= PIL_check_seconds_timer();
+                       }
+
                        /* add temp handler */
                        WM_event_add_modal_handler(C, op);