@@ -3379,6 +3379,7 @@ void ViewProviderSketch::drawConstraintIcons()
3379
3379
3380
3380
// Find the Constraint Icon SoImage Node
3381
3381
SoSeparator *sep = static_cast <SoSeparator *>(edit->constrGroup ->getChild (constrId));
3382
+ int numChildren = sep->getNumChildren ();
3382
3383
3383
3384
SbVec3f absPos;
3384
3385
// Somewhat hacky - we use SoZoomTranslations for most types of icon,
@@ -3442,14 +3443,16 @@ void ViewProviderSketch::drawConstraintIcons()
3442
3443
// So, to get the position of the second icon, we add the two translations together
3443
3444
//
3444
3445
// See note ~30 lines up.
3445
- translationPtr = static_cast <SoTranslation *>(sep->getChild (CONSTRAINT_SEPARATOR_INDEX_SECOND_TRANSLATION));
3446
- if (dynamic_cast <SoZoomTranslation *>(translationPtr))
3447
- thisIcon.position += static_cast <SoZoomTranslation *>(translationPtr)->abPos .getValue ();
3448
- else
3449
- thisIcon.position += translationPtr->translation .getValue ();
3446
+ if (numChildren > CONSTRAINT_SEPARATOR_INDEX_SECOND_CONSTRAINTID) {
3447
+ translationPtr = static_cast <SoTranslation *>(sep->getChild (CONSTRAINT_SEPARATOR_INDEX_SECOND_TRANSLATION));
3448
+ if (dynamic_cast <SoZoomTranslation *>(translationPtr))
3449
+ thisIcon.position += static_cast <SoZoomTranslation *>(translationPtr)->abPos .getValue ();
3450
+ else
3451
+ thisIcon.position += translationPtr->translation .getValue ();
3450
3452
3451
- thisIcon.destination = dynamic_cast <SoImage *>(sep->getChild (CONSTRAINT_SEPARATOR_INDEX_SECOND_ICON));
3452
- thisIcon.infoPtr = static_cast <SoInfo *>(sep->getChild (CONSTRAINT_SEPARATOR_INDEX_SECOND_CONSTRAINTID));
3453
+ thisIcon.destination = dynamic_cast <SoImage *>(sep->getChild (CONSTRAINT_SEPARATOR_INDEX_SECOND_ICON));
3454
+ thisIcon.infoPtr = static_cast <SoInfo *>(sep->getChild (CONSTRAINT_SEPARATOR_INDEX_SECOND_CONSTRAINTID));
3455
+ }
3453
3456
}
3454
3457
else {
3455
3458
if ((*it)->Name .empty ())
0 commit comments