diff --git a/source/blender/editors/space_sequencer/sequencer_select.cc b/source/blender/editors/space_sequencer/sequencer_select.cc index 1049416cbe5..4cce996aad7 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.cc +++ b/source/blender/editors/space_sequencer/sequencer_select.cc @@ -1058,14 +1058,10 @@ static blender::Vector mouseover_strips_sorted_get(const Scene *scen strips.append(seq); } - BLI_assert(strips.size() <= 2); - - /* Ensure that `strips[0]` is the strip closest to the mouse cursor. */ - if (strips.size() == 2 && strip_to_frame_distance(scene, v2d, strips[0], mouse_co[0]) > - strip_to_frame_distance(scene, v2d, strips[1], mouse_co[0])) - { - std::swap(strips[0], strips[1]); - } + std::sort(strips.begin(), strips.end(), [&](const Sequence *seq1, const Sequence *seq2) { + return strip_to_frame_distance(scene, v2d, seq1, mouse_co[0]) < + strip_to_frame_distance(scene, v2d, seq2, mouse_co[0]); + }); return strips; }