diff options
Diffstat (limited to 'source/blender/sequencer/intern/strip_time.c')
-rw-r--r-- | source/blender/sequencer/intern/strip_time.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/sequencer/intern/strip_time.c b/source/blender/sequencer/intern/strip_time.c index 40d7fade308..b8b6f62c7aa 100644 --- a/source/blender/sequencer/intern/strip_time.c +++ b/source/blender/sequencer/intern/strip_time.c @@ -409,7 +409,7 @@ static bool strip_exists_at_frame(SeqCollection *all_strips, const int timeline_ { Sequence *seq; SEQ_ITERATOR_FOREACH (seq, all_strips) { - if ((seq->startdisp <= timeline_frame) && (seq->enddisp > timeline_frame)) { + if (SEQ_time_strip_intersects_frame(seq, timeline_frame)) { return true; } } @@ -468,3 +468,17 @@ void seq_time_gap_info_get(const Scene *scene, } } } + +/** + * Test if strip intersects with timeline frame. + * Note: This checks if strip would be rendered at this frame. For rendering it is assumed, that + * timeline frame has width of 1 frame and therefore ends at timeline_frame + 1 + * + * \param seq: Sequence to be checked + * \param timeline_frame: absolute frame position + * \return true if strip intersects with timeline frame. + */ +bool SEQ_time_strip_intersects_frame(const Sequence *seq, const int timeline_frame) +{ + return (seq->startdisp <= timeline_frame) && (seq->enddisp > timeline_frame); +} |