Fix #23219: smooth view rotating in top view could generate NaN-values,
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 12 Aug 2010 17:48:25 +0000 (17:48 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 12 Aug 2010 17:48:25 +0000 (17:48 +0000)
causing 3d view drawing to break.

source/blender/editors/space_view3d/view3d_view.c

index aad91e74af9e995c9bfd8af4bc4395184c90488b..334b72ee1ed5ab3ac3cdce7d6dd9e9d11ef2b134 100644 (file)
@@ -306,7 +306,10 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *op, wmEvent *event)
        if(rv3d->smooth_timer==NULL || rv3d->smooth_timer!=event->customdata)
                return OPERATOR_PASS_THROUGH;
        
-       step =  (rv3d->smooth_timer->duration)/sms->time_allowed;
+       if(sms->time_allowed != 0.0f)
+               step = (rv3d->smooth_timer->duration)/sms->time_allowed;
+       else
+               step = 1.0f;
        
        /* end timer */
        if(step >= 1.0f) {