diff options
author | Joshua Leung <aligorith@gmail.com> | 2018-05-24 14:47:33 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2018-05-24 16:05:17 +0300 |
commit | fe820eba925d09db5f72eaf41842943344cc8d2f (patch) | |
tree | e5053dcd888bd2a8deff125567fde405870a6194 | |
parent | dfb959b6c36129b96abe66c39e57d90a07458716 (diff) |
Cleanup: Some minor tweaks to code
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 711bdac9dc0..446089d943e 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -2122,25 +2122,24 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, b continue; } /* Loop over contiguous bone hits for 'base'. */ - bool bone_selected = false; + bool changed = false; for (; col != col_end; col += 4) { /* should never fail */ if (bone != NULL) { if (select) { if ((bone->flag & BONE_UNSELECTABLE) == 0) { bone->flag |= BONE_SELECTED; - bone_selected = true; } } else { bArmature *arm = base->object->data; if ((bone->flag & BONE_UNSELECTABLE) == 0) { bone->flag &= ~BONE_SELECTED; - bone_selected = true; if (arm->act_bone == bone) arm->act_bone = NULL; } } + changed = true; } else if (!bone_only) { ED_object_base_select(base, select ? BA_SELECT : BA_DESELECT); @@ -2154,7 +2153,7 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, b if ((base->object->pose != NULL) && bone_only) { const uint hit_bone = (col[4] & ~BONESEL_ANY) >> 16; - bPoseChannel *pchan = BLI_findlink(&base->object->pose->chanbase, hit_bone);; + bPoseChannel *pchan = BLI_findlink(&base->object->pose->chanbase, hit_bone); bone = pchan ? pchan->bone : NULL; } else { @@ -2163,7 +2162,7 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, b } } - if (bone_selected) { + if (changed) { if (base->object && (base->object->type == OB_ARMATURE)) { bArmature *arm = base->object->data; |