[TD]Fix group item moving when locked

This commit is contained in:
Wanderer Fan
2022-05-12 12:25:24 -04:00
committed by WandererFan
parent b96a650dec
commit 00c8916341
3 changed files with 21 additions and 25 deletions

View File

@@ -424,19 +424,9 @@ void QGIView::draw()
if (getViewObject() != nullptr) {
x = Rez::guiX(getViewObject()->X.getValue());
y = Rez::guiX(getViewObject()->Y.getValue());
if (getFrameState()) {
//+/- space for label if DPGI
TechDraw::DrawProjGroupItem* dpgi = dynamic_cast<TechDraw::DrawProjGroupItem*>(getViewObject());
if (dpgi != nullptr) {
double vertLabelSpace = Rez::guiX(Preferences::labelFontSizeMM());
if (y > 0) {
y += vertLabelSpace;
} else if (y < 0) {
y -= vertLabelSpace;
}
}
if (!getViewObject()->LockPosition.getValue()) {
setPosition(x, y);
}
setPosition(x, y);
}
if (isVisible()) {
drawBorder();
@@ -453,7 +443,6 @@ void QGIView::drawCaption()
QRectF displayArea = customChildrenBoundingRect();
m_caption->setDefaultTextColor(m_colCurrent);
m_font.setFamily(getPrefFont());
// m_font.setPixelSize(calculateFontPixelSize(getPrefFontSize()));
m_font.setPixelSize(PreferencesGui::labelFontSizePX());
m_caption->setFont(m_font);
QString captionStr = QString::fromUtf8(getViewObject()->Caption.getValue());
@@ -466,7 +455,6 @@ void QGIView::drawCaption()
if (getFrameState() || vp->KeepLabel.getValue()) { //place below label if label visible
m_caption->setY(displayArea.bottom() + labelHeight);
} else {
// m_caption->setY(displayArea.bottom() + labelCaptionFudge * getPrefFontSize());
m_caption->setY(displayArea.bottom() + labelCaptionFudge * Preferences::labelFontSizeMM());
}
m_caption->show();
@@ -496,7 +484,6 @@ void QGIView::drawBorder()
m_label->setDefaultTextColor(m_colCurrent);
m_font.setFamily(getPrefFont());
// m_font.setPixelSize(calculateFontPixelSize(getPrefFontSize()));
m_font.setPixelSize(PreferencesGui::labelFontSizePX());
m_label->setFont(m_font);