Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_graph/graph_edit.c
| Show First 20 Lines • Show All 286 Lines • ▼ Show 20 Lines | get_graph_keyframe_extents(&ac, | ||||
| &cur_new.ymin, | &cur_new.ymin, | ||||
| &cur_new.ymax, | &cur_new.ymax, | ||||
| do_sel_only, | do_sel_only, | ||||
| include_handles); | include_handles); | ||||
| /* Give some more space at the borders. */ | /* Give some more space at the borders. */ | ||||
| BLI_rctf_scale(&cur_new, 1.1f); | BLI_rctf_scale(&cur_new, 1.1f); | ||||
| /* Take regions into account, that could block the view. */ | /* Take regions into account, that could block the view. Marker region is supposed to be larger | ||||
| * than the scrollbar, so priorize it.*/ | |||||
| float pad_top = UI_TIME_SCRUB_MARGIN_Y; | float pad_top = UI_TIME_SCRUB_MARGIN_Y; | ||||
| float pad_bottom = 0; | float pad_bottom = BLI_listbase_is_empty(ED_context_get_markers(C)) ? V2D_SCROLL_HANDLE_HEIGHT : | ||||
| if (!BLI_listbase_is_empty(ED_context_get_markers(C))) { | UI_MARKER_MARGIN_Y; | ||||
| pad_bottom = UI_MARKER_MARGIN_Y; | |||||
| } | |||||
| BLI_rctf_pad_y(&cur_new, ac.ar->winy, pad_bottom, pad_top); | BLI_rctf_pad_y(&cur_new, ac.ar->winy, pad_bottom, pad_top); | ||||
| UI_view2d_smooth_view(C, ac.ar, &cur_new, smooth_viewtx); | UI_view2d_smooth_view(C, ac.ar, &cur_new, smooth_viewtx); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
sybren: Initialising to `0` doesn't make much sense to me here. Why not default to… | |||||
| } | } | ||||
| /* ......... */ | /* ......... */ | ||||
| static int graphkeys_viewall_exec(bContext *C, wmOperator *op) | static int graphkeys_viewall_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| const bool include_handles = RNA_boolean_get(op->ptr, "include_handles"); | const bool include_handles = RNA_boolean_get(op->ptr, "include_handles"); | ||||
| const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); | const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); | ||||
| ▲ Show 20 Lines • Show All 3,339 Lines • Show Last 20 Lines | |||||
Initialising to 0 doesn't make much sense to me here. Why not default to V2D_SCROLL_HANDLE_HEIGHT instead?