From 7eeebbed5339612831bb0d3cfae4d121f2050807 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 14 Jan 2014 11:48:34 +0100 Subject: [PATCH] fixes #0001191: Cannot manipulate length if moved away from between the 'red lines' --- src/Mod/Sketcher/Gui/SoDatumLabel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Mod/Sketcher/Gui/SoDatumLabel.cpp b/src/Mod/Sketcher/Gui/SoDatumLabel.cpp index 362264eb6..50bcb3e94 100644 --- a/src/Mod/Sketcher/Gui/SoDatumLabel.cpp +++ b/src/Mod/Sketcher/Gui/SoDatumLabel.cpp @@ -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::const_iterator it=corners.begin(); it != corners.end(); ++it) { minX = ((*it)[0] < minX) ? (*it)[0] : minX;