Fix bones without parents missing head vertex

When the connected was enabled for a parentless bone the head vertex
wasn't displayed and couldn't be selected.
This commit is contained in:
Campbell Barton
2019-10-30 03:18:48 +11:00
parent 87ac3d14b2
commit f20cd49c30

View File

@@ -1350,7 +1350,8 @@ static void draw_points(const EditBone *eBone,
bone_hint_color_shade(col_hint_tail, (g_theme.const_color) ? col_solid_tail : col_wire_tail);
/* Draw root point if we are not connected to our parent */
if ((BONE_FLAG(eBone, pchan) & BONE_CONNECTED) == 0) {
if (!(eBone ? (eBone->parent && (eBone->flag & BONE_CONNECTED)) :
(pchan->bone->parent && (pchan->bone->flag & BONE_CONNECTED)))) {
if (select_id != -1) {
DRW_select_load_id(select_id | BONESEL_ROOT);
}
@@ -1518,30 +1519,33 @@ static void draw_bone_line(EditBone *eBone,
const float *col_head = no_display;
const float *col_tail = col_bone;
if (eBone) {
if (eBone->flag & BONE_TIPSEL) {
col_tail = g_theme.vertex_select_color;
}
if (boneflag & BONE_SELECTED) {
col_bone = g_theme.edge_select_color;
}
col_wire = g_theme.wire_color;
}
/* Draw root point if we are not connected to our parent */
if ((BONE_FLAG(eBone, pchan) & BONE_CONNECTED) == 0) {
if (eBone) {
col_head = (eBone->flag & BONE_ROOTSEL) ? g_theme.vertex_select_color : col_bone;
}
else if (pchan) {
col_head = col_bone;
}
}
if (g_theme.const_color != NULL) {
col_wire = no_display; /* actually shrink the display. */
col_bone = col_head = col_tail = g_theme.const_color;
}
else {
if (eBone) {
if (eBone->flag & BONE_TIPSEL) {
col_tail = g_theme.vertex_select_color;
}
if (boneflag & BONE_SELECTED) {
col_bone = g_theme.edge_select_color;
}
col_wire = g_theme.wire_color;
}
/* Draw root point if we are not connected to our parent. */
if (!(eBone ? (eBone->parent && (eBone->flag & BONE_CONNECTED)) :
(pchan->bone->parent && (pchan->bone->flag & BONE_CONNECTED)))) {
if (eBone) {
col_head = (eBone->flag & BONE_ROOTSEL) ? g_theme.vertex_select_color : col_bone;
}
else {
col_head = col_bone;
}
}
}
if (select_id == -1) {
/* Not in selection mode, draw everything at once. */