Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Antalik <richardantalik@gmail.com>2022-10-04 20:50:13 +0300
committerRichard Antalik <richardantalik@gmail.com>2022-10-04 22:24:09 +0300
commit76043bc3d62c5a23f182c2cf0521e787600bd0d7 (patch)
tree07848c26ba6582bcbcd49bd6313a7dfaccac1c98 /source/blender/editors
parentd981418c8ce0016e1cd778f4ddaf558cb7b0e724 (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')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c11
-rw-r--r--source/blender/editors/space_sequencer/sequencer_thumbnails.c5
-rw-r--r--source/blender/editors/transform/transform_snap_sequencer.c6
3 files changed, 11 insertions, 11 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;
}
diff --git a/source/blender/editors/transform/transform_snap_sequencer.c b/source/blender/editors/transform/transform_snap_sequencer.c
index 06d9bb05206..ed8b201240b 100644
--- a/source/blender/editors/transform/transform_snap_sequencer.c
+++ b/source/blender/editors/transform/transform_snap_sequencer.c
@@ -203,8 +203,10 @@ static void seq_snap_target_points_build(Scene *scene,
i += 2;
if (snap_mode & SEQ_SNAP_TO_STRIP_HOLD) {
- int content_start = min_ii(SEQ_time_right_handle_frame_get(scene, seq), seq->start);
- int content_end = max_ii(SEQ_time_left_handle_frame_get(scene, seq), seq->start + seq->len);
+ int content_start = min_ii(SEQ_time_left_handle_frame_get(scene, seq),
+ SEQ_time_start_frame_get(seq));
+ int content_end = max_ii(SEQ_time_right_handle_frame_get(scene, seq),
+ SEQ_time_content_end_frame_get(scene, seq));
/* Effects and single image strips produce incorrect content length. Skip these strips. */
if ((seq->type & SEQ_TYPE_EFFECT) != 0 || seq->len == 1) {
content_start = SEQ_time_left_handle_frame_get(scene, seq);