diff --git a/src/Mod/Sketcher/Gui/SoDatumLabel.cpp b/src/Mod/Sketcher/Gui/SoDatumLabel.cpp index 86bdfc20db..442e674af8 100644 --- a/src/Mod/Sketcher/Gui/SoDatumLabel.cpp +++ b/src/Mod/Sketcher/Gui/SoDatumLabel.cpp @@ -338,8 +338,8 @@ void SoDatumLabel::generatePrimitives(SoAction * action) SoState *state = action->getState(); const SbViewVolume & vv = SoViewVolumeElement::get(state); float scale = vv.getWorldToScreenScale(SbVec3f(0.f,0.f,0.f), 1.0f); - SbVec2s vp_size = static_cast(action)->getViewportRegion().getWindowSize(); - scale /= float(vp_size[0]); + SbVec2s vp_size = SoViewportRegionElement::get(state).getWindowSize(); + scale /= float(vp_size[0]); SbVec3f dir = (p2-p1); dir.normalize(); @@ -458,6 +458,14 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) this->imgHeight = scale * (float) (srch); this->imgWidth = aspectRatio * (float) this->imgHeight; } + + if (this->datumtype.getValue() == SYMMETRIC) { + // For the symmetry constraint that does not have text, but does have arrows + //this->imgHeight = 3.36f; + //this->imgWidth = 5.26f; + this->imgHeight = 1.5f; + this->imgWidth = 1.5f; + } // Get the points stored in the pnt field const SbVec3f *pnts = this->pnts.getValues(0); diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index e7cc851987..3dd10d8311 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -1483,7 +1483,9 @@ std::set ViewProviderSketch::detectPreselectionConstr(const SoPickedPoint * } else { // Assume second icon was hit - constrIds = static_cast(sep->getChild(CONSTRAINT_SEPARATOR_INDEX_SECOND_CONSTRAINTID)); + if(CONSTRAINT_SEPARATOR_INDEX_SECOND_CONSTRAINTIDgetNumChildren()){ + constrIds = static_cast(sep->getChild(CONSTRAINT_SEPARATOR_INDEX_SECOND_CONSTRAINTID)); + } } if(constrIds) { QString constrIdsStr = QString::fromAscii(constrIds->string.getValue().getString());