diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-10-09 10:53:42 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-10-09 11:08:31 +0300 |
commit | e541f37529ac2e9fb2ae7ae2f920f304f70dc1ae (patch) | |
tree | 1bce6df065c2c885bdfc891a8d46ad9cac48aa7f /source/blender/editors/space_sequencer | |
parent | 27ac80f068a94acbd1c04df45db00787da7299d3 (diff) |
Fix T91978: VSE box select substract doesn't work
Substract and add modes were not implemented. Add logic to handle these
modes.
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_select.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index 7722909190f..e193cde4535 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -1482,7 +1482,7 @@ static bool seq_box_select_rect_image_isect(const Scene *scene, const Sequence * seq_image_quad[3], rect_quad[0], rect_quad[1], rect_quad[2], rect_quad[3]); } -static void seq_box_select_seq_from_preview(const bContext *C, rctf *rect) +static void seq_box_select_seq_from_preview(const bContext *C, rctf *rect, const eSelectOp mode) { Scene *scene = CTX_data_scene(C); Editing *ed = SEQ_editing_get(scene); @@ -1492,9 +1492,17 @@ static void seq_box_select_seq_from_preview(const bContext *C, rctf *rect) SeqCollection *strips = SEQ_query_rendered_strips(seqbase, scene->r.cfra, sseq->chanshown); Sequence *seq; SEQ_ITERATOR_FOREACH (seq, strips) { - if (seq_box_select_rect_image_isect(scene, seq, rect)) { + if (!seq_box_select_rect_image_isect(scene, seq, rect)) { + continue; + } + + if (ELEM(mode, SEL_OP_ADD, SEL_OP_SET)) { seq->flag |= SELECT; } + else { + BLI_assert(mode == SEL_OP_SUB); + seq->flag &= ~SELECT; + } } SEQ_collection_free(strips); @@ -1524,7 +1532,7 @@ static int sequencer_box_select_exec(bContext *C, wmOperator *op) ARegion *region = CTX_wm_region(C); if (region->regiontype == RGN_TYPE_PREVIEW) { - seq_box_select_seq_from_preview(C, &rectf); + seq_box_select_seq_from_preview(C, &rectf, sel_op); sequencer_select_do_updates(C, scene); return OPERATOR_FINISHED; } @@ -1664,7 +1672,8 @@ static const EnumPropertyItem sequencer_prop_select_grouped_types[] = { "EFFECT_LINK", 0, "Effect/Linked", - "Other strips affected by the active one (sharing some time, and below or effect-assigned)"}, + "Other strips affected by the active one (sharing some time, and below or " + "effect-assigned)"}, {SEQ_SELECT_GROUP_OVERLAP, "OVERLAP", 0, "Overlap", "Overlapping time"}, {0, NULL, 0, NULL, NULL}, }; |