diff options
author | Richard Antalik <richardantalik@gmail.com> | 2022-10-04 20:50:13 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2022-10-04 22:24:09 +0300 |
commit | 76043bc3d62c5a23f182c2cf0521e787600bd0d7 (patch) | |
tree | 07848c26ba6582bcbcd49bd6313a7dfaccac1c98 /source/blender/editors/space_sequencer | |
parent | d981418c8ce0016e1cd778f4ddaf558cb7b0e724 (diff) |
Cleanup: VSE code readability
Add function `SEQ_time_content_end_frame_get` to get content end frame.
New function is shorthand for
`SEQ_time_start_frame_get() + SEQ_time_strip_length_get()`.
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_thumbnails.c | 5 |
2 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index ce12629f9d6..6ebc3e95b70 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -963,8 +963,7 @@ static void draw_sequence_extensions_overlay( UI_GetColorPtrShade3ubv(col, blend_col, 10); const float strip_content_start = SEQ_time_start_frame_get(seq); - const float strip_content_end = SEQ_time_start_frame_get(seq) + - SEQ_time_strip_length_get(scene, seq); + const float strip_content_end = SEQ_time_content_end_frame_get(scene, seq); float right_handle_frame = SEQ_time_right_handle_frame_get(scene, seq); float left_handle_frame = SEQ_time_left_handle_frame_get(scene, seq); @@ -1095,8 +1094,7 @@ static void draw_seq_background(Scene *scene, } if (SEQ_time_has_right_still_frames(scene, seq)) { float right_handle_frame = SEQ_time_right_handle_frame_get(scene, seq); - const float content_end = SEQ_time_start_frame_get(seq) + - SEQ_time_strip_length_get(scene, seq); + const float content_end = SEQ_time_content_end_frame_get(scene, seq); immRectf(pos, content_end, y1, right_handle_frame, y2); } } @@ -1317,8 +1315,7 @@ static void draw_seq_strip(const bContext *C, x1 = SEQ_time_has_left_still_frames(scene, seq) ? SEQ_time_start_frame_get(seq) : SEQ_time_left_handle_frame_get(scene, seq); y1 = seq->machine + SEQ_STRIP_OFSBOTTOM; - x2 = SEQ_time_has_right_still_frames(scene, seq) ? - SEQ_time_start_frame_get(seq) + SEQ_time_strip_length_get(scene, seq) : + x2 = SEQ_time_has_right_still_frames(scene, seq) ? SEQ_time_content_end_frame_get(scene, seq) : SEQ_time_right_handle_frame_get(scene, seq); y2 = seq->machine + SEQ_STRIP_OFSTOP; @@ -2290,7 +2287,7 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *region) continue; } if (max_ii(SEQ_time_right_handle_frame_get(scene, seq), - SEQ_time_start_frame_get(seq) + SEQ_time_strip_length_get(scene, seq)) < + SEQ_time_content_end_frame_get(scene, seq)) < v2d->cur.xmin) { continue; } diff --git a/source/blender/editors/space_sequencer/sequencer_thumbnails.c b/source/blender/editors/space_sequencer/sequencer_thumbnails.c index 6f443d0353e..36f2aa87d9d 100644 --- a/source/blender/editors/space_sequencer/sequencer_thumbnails.c +++ b/source/blender/editors/space_sequencer/sequencer_thumbnails.c @@ -74,10 +74,11 @@ static bool check_seq_need_thumbnails(const Scene *scene, Sequence *seq, rctf *v if (!ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE)) { return false; } - if (min_ii(SEQ_time_left_handle_frame_get(scene, seq), seq->start) > view_area->xmax) { + if (min_ii(SEQ_time_left_handle_frame_get(scene, seq), SEQ_time_start_frame_get(seq)) > + view_area->xmax) { return false; } - if (max_ii(SEQ_time_right_handle_frame_get(scene, seq), seq->start + seq->len) < + if (max_ii(SEQ_time_right_handle_frame_get(scene, seq), SEQ_time_content_end_frame_get(scene, seq)) < view_area->xmin) { return false; } |