Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/view2d_ops.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| dx = RNA_float_get(op->ptr, "deltax") / U.dpi_fac; | dx = RNA_float_get(op->ptr, "deltax") / U.dpi_fac; | ||||
| dy = RNA_float_get(op->ptr, "deltay") / U.dpi_fac; | dy = RNA_float_get(op->ptr, "deltay") / U.dpi_fac; | ||||
| if (U.uiflag & USER_ZOOM_INVERT) { | if (U.uiflag & USER_ZOOM_INVERT) { | ||||
| dx *= -1; | dx *= -1; | ||||
| dy *= -1; | dy *= -1; | ||||
| } | } | ||||
| /* continuous zoom shouldn't move that fast... */ | /* Check if the 'timer' is initialized, as zooming with the trackpad | ||||
| if (U.viewzoom == USER_ZOOM_CONT) { /* XXX store this setting as RNA prop? */ | * never uses the "Continue" zoom method, and the 'timer' is not initialized. */ | ||||
| if ((U.viewzoom == USER_ZOOM_CONT) && vzd->timer) { /* XXX store this setting as RNA prop? */ | |||||
| const double time = PIL_check_seconds_timer(); | const double time = PIL_check_seconds_timer(); | ||||
| const float time_step = (float)(time - vzd->timer_lastdraw); | const float time_step = (float)(time - vzd->timer_lastdraw); | ||||
| dx *= time_step * 0.5f; | dx *= time_step * 0.5f; | ||||
| dy *= time_step * 0.5f; | dy *= time_step * 0.5f; | ||||
| vzd->timer_lastdraw = time; | vzd->timer_lastdraw = time; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||