diff --git a/src/Mod/TechDraw/App/DrawView.cpp b/src/Mod/TechDraw/App/DrawView.cpp index 392c453502..f7dd2c0134 100644 --- a/src/Mod/TechDraw/App/DrawView.cpp +++ b/src/Mod/TechDraw/App/DrawView.cpp @@ -192,7 +192,8 @@ short DrawView::mustExecute() const ScaleType.isTouched() || Caption.isTouched() || X.isTouched() || - Y.isTouched() ); + Y.isTouched() || + LockPosition.isTouched()); } if ((bool) result) { return result; diff --git a/src/Mod/TechDraw/Gui/QGCustomLabel.cpp b/src/Mod/TechDraw/Gui/QGCustomLabel.cpp index 4ab194f3a9..50024743fc 100644 --- a/src/Mod/TechDraw/Gui/QGCustomLabel.cpp +++ b/src/Mod/TechDraw/Gui/QGCustomLabel.cpp @@ -76,6 +76,8 @@ void QGCustomLabel::centerAt(double cX, double cY) void QGCustomLabel::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) { QStyleOptionGraphicsItem myOption(*option); myOption.state &= ~QStyle::State_Selected; - + +// painter->drawRect(boundingRect()); //good for debugging + QGraphicsTextItem::paint (painter, &myOption, widget); } diff --git a/src/Mod/TechDraw/Gui/QGIView.cpp b/src/Mod/TechDraw/Gui/QGIView.cpp index eb6b514f00..b91eec3f88 100644 --- a/src/Mod/TechDraw/Gui/QGIView.cpp +++ b/src/Mod/TechDraw/Gui/QGIView.cpp @@ -108,7 +108,7 @@ QGIView::QGIView() m_caption = new QGICaption(); addToGroup(m_caption); m_lock = new QGCustomImage(); - m_lock->setParentItem(m_label); + m_lock->setParentItem(m_border); m_lock->load(QString::fromUtf8(":/icons/techdraw-lock.png")); QSize sizeLock = m_lock->imageSize(); m_lockWidth = (double) sizeLock.width(); @@ -403,14 +403,6 @@ void QGIView::toggleCache(bool state) setCacheMode(NoCache); } -////this is obs? -//void QGIView::toggleBorder(bool state) -//{ -// Base::Console().Message("QGIV::toggleBorder(%d)\n",state); -//// m_borderVisible = state; -//// QGIView::draw(); -//} - void QGIView::draw() { if (isVisible()) { @@ -474,7 +466,7 @@ void QGIView::drawBorder() m_label->setFont(m_font); QString labelStr = QString::fromUtf8(getViewObject()->Label.getValue()); m_label->setPlainText(labelStr); - QRectF labelArea = m_label->boundingRect(); + QRectF labelArea = m_label->boundingRect(); //m_label coords double labelWidth = m_label->boundingRect().width(); double labelHeight = (1 - labelCaptionFudge) * m_label->boundingRect().height(); @@ -501,8 +493,8 @@ void QGIView::drawBorder() frameWidth, frameHeight); - double lockX = labelArea.left(); - double lockY = labelArea.bottom() - (2 * m_lockHeight); + double lockX = frameArea.left(); + double lockY = frameArea.bottom() - m_lockHeight; if (feat->isLocked()) { m_lock->setZValue(ZVALUE::LOCK); m_lock->setPos(lockX,lockY);