Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_sequencer/sequencer_view.c
| Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| ARegion *region = CTX_wm_region(C); | ARegion *region = CTX_wm_region(C); | ||||
| rctf box; | rctf box; | ||||
| const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); | const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| const Editing *ed = SEQ_editing_get(scene); | const Editing *ed = SEQ_editing_get(scene); | ||||
| SEQ_timeline_boundbox(scene, SEQ_active_seqbase_get(ed), &box); | SEQ_timeline_init_boundbox(scene, &box); | ||||
beco: Here I called `SEQ_timeline_init_boundbox` for the "magic numbers" it uses for the `y-axis` (I… | |||||
| bool inside_meta = !BLI_listbase_is_empty(&ed->metastack); | |||||
| if (inside_meta) { | |||||
| MetaStack *ms = SEQ_meta_stack_active_get(ed); | |||||
ISSUnsubmitted Done Inline ActionsI would preffer getting active metastack and then just check if you get NULL instead of accessing Editing members directly. ISS: I would preffer getting active metastack and then just check if you get `NULL` instead of… | |||||
| box.xmin = ms->disp_range[0] - 1; | |||||
| box.xmax = ms->disp_range[1] + 1; | |||||
| } | |||||
| SEQ_timeline_expand_boundbox(SEQ_active_seqbase_get(ed), &box); | |||||
| UI_view2d_smooth_view(C, region, &box, smooth_viewtx); | UI_view2d_smooth_view(C, region, &box, smooth_viewtx); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void SEQUENCER_OT_view_all(wmOperatorType *ot) | void SEQUENCER_OT_view_all(wmOperatorType *ot) | ||||
| { | { | ||||
| /* Identifiers. */ | /* Identifiers. */ | ||||
| ot->name = "Frame All"; | ot->name = "Frame All"; | ||||
| ▲ Show 20 Lines • Show All 308 Lines • Show Last 20 Lines | |||||
Here I called SEQ_timeline_init_boundbox for the "magic numbers" it uses for the y-axis (I wanted to avoid duplicating those 0.0 and 8.0 initial values and keep them in a single place instead).