Skip to content

Commit

Permalink
fixes #1191: Cannot manipulate length if moved away from between the …
Browse files Browse the repository at this point in the history
…'red lines'
  • Loading branch information
wwmayer committed Jan 14, 2014
1 parent 6245957 commit 7eeebbe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Mod/Sketcher/Gui/SoDatumLabel.cpp
Expand Up @@ -604,6 +604,12 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action)
corners.push_back(perp1);
corners.push_back(perp2);

// Make sure that the label is inside the bounding box
corners.push_back(textOffset + dir * (this->imgWidth / 2 + margin) + norm * (this->imgHeight + margin));
corners.push_back(textOffset - dir * (this->imgWidth / 2 + margin) + norm * (this->imgHeight + margin));
corners.push_back(textOffset + dir * (this->imgWidth / 2 + margin) - norm * margin);
corners.push_back(textOffset - dir * (this->imgWidth / 2 + margin) - norm * margin);

float minX = p1[0], minY = p1[1], maxX = p1[0] , maxY = p1[1];
for (std::vector<SbVec3f>::const_iterator it=corners.begin(); it != corners.end(); ++it) {
minX = ((*it)[0] < minX) ? (*it)[0] : minX;
Expand Down

0 comments on commit 7eeebbe

Please sign in to comment.