From 0b5b543b7cec64d545ec770e1a70409560e39d56 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 15 Aug 2018 17:44:50 +0200 Subject: Fix pose mode border deselect not working after recent changes. --- .../blender/editors/space_view3d/view3d_select.c | 26 +++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'source/blender/editors/space_view3d/view3d_select.c') diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index f91876a01bd..1df3aecb8d8 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -2345,17 +2345,23 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, c for (; col != col_end; col += 4) { /* should never fail */ if (bone != NULL) { - if (sel_op) { - if ((bone->flag & BONE_UNSELECTABLE) == 0) { - bone->flag |= BONE_SELECTED; + const bool is_select = (bone->flag & BONE_SELECTED) != 0; + const bool is_inside = true; + const int sel_op_result = ED_select_op_action_deselected(sel_op, is_select, is_inside); + + if (sel_op_result != -1) { + if (sel_op_result) { + if ((bone->flag & BONE_UNSELECTABLE) == 0) { + bone->flag |= BONE_SELECTED; + } } - } - else { - bArmature *arm = base->object->data; - if ((bone->flag & BONE_UNSELECTABLE) == 0) { - bone->flag &= ~BONE_SELECTED; - if (arm->act_bone == bone) - arm->act_bone = NULL; + else { + bArmature *arm = base->object->data; + if ((bone->flag & BONE_UNSELECTABLE) == 0) { + bone->flag &= ~BONE_SELECTED; + if (arm->act_bone == bone) + arm->act_bone = NULL; + } } } changed = true; -- cgit v1.2.3