Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/view2d_ops.c
| Show First 20 Lines • Show All 1,564 Lines • ▼ Show 20 Lines | for (int i = 0; i < 2; i++) { | ||||
| fac_max = max_ff(fac_max, tfac); | fac_max = max_ff(fac_max, tfac); | ||||
| if (fac_max >= 1.0f) { | if (fac_max >= 1.0f) { | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| return min_ff(fac_max, 1.0f); | return min_ff(fac_max, 1.0f); | ||||
| } | } | ||||
| /* will start timer if appropriate */ | |||||
| /* the arguments are the desired situation */ | |||||
| void UI_view2d_smooth_view(bContext *C, ARegion *region, const rctf *cur, const int smooth_viewtx) | void UI_view2d_smooth_view(bContext *C, ARegion *region, const rctf *cur, const int smooth_viewtx) | ||||
| { | { | ||||
| wmWindowManager *wm = CTX_wm_manager(C); | wmWindowManager *wm = CTX_wm_manager(C); | ||||
| wmWindow *win = CTX_wm_window(C); | wmWindow *win = CTX_wm_window(C); | ||||
| View2D *v2d = ®ion->v2d; | View2D *v2d = ®ion->v2d; | ||||
| struct SmoothView2DStore sms = {{0}}; | struct SmoothView2DStore sms = {{0}}; | ||||
| bool ok = false; | bool ok = false; | ||||
| ▲ Show 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | |||||
| * This is a CUT DOWN VERSION of the 'real' version, which is defined in view2d.c, | * This is a CUT DOWN VERSION of the 'real' version, which is defined in view2d.c, | ||||
| * as we only need focus bubble info. | * as we only need focus bubble info. | ||||
| * | * | ||||
| * \warning The start of this struct must not change, | * \warning The start of this struct must not change, | ||||
| * so that it stays in sync with the 'real' version. | * so that it stays in sync with the 'real' version. | ||||
| * For now, we don't need to have a separate (internal) header for structs like this... | * For now, we don't need to have a separate (internal) header for structs like this... | ||||
| */ | */ | ||||
| struct View2DScrollers { | struct View2DScrollers { | ||||
| /* focus bubbles */ | |||||
| int vert_min, vert_max; /* vertical scrollbar */ | int vert_min, vert_max; /* vertical scrollbar */ | ||||
| int hor_min, hor_max; /* horizontal scrollbar */ | int hor_min, hor_max; /* horizontal scrollbar */ | ||||
| /* These values are written into, even if we don't use them. */ | /* These values are written into, even if we don't use them. */ | ||||
| rcti _hor, _vert; | rcti _hor, _vert; | ||||
| }; | }; | ||||
| /* quick enum for vsm->zone (scroller handles) */ | /* quick enum for vsm->zone (scroller handles) */ | ||||
| ▲ Show 20 Lines • Show All 529 Lines • Show Last 20 Lines | |||||