[TD]Dimension font clipping (fix #11452) (#18771)

* [TD]separate alignment and rendering bounding rectangles

* [TD]use alignment rectangle (fix #11452)
This commit is contained in:
WandererFan
2025-01-13 12:13:59 -05:00
committed by GitHub
parent 382d13ee77
commit e9c30cf370
3 changed files with 19 additions and 18 deletions

View File

@@ -418,21 +418,21 @@ void QGIDatumLabel::setPosFromCenter(const double& xCenter, const double& yCente
m_unitText->setPlainText(QString());
}
QRectF labelBox = m_dimText->boundingRect();
QRectF labelBox = m_dimText->alignmentRect();
double right = labelBox.right();
double top = labelBox.top();
double bottom = labelBox.bottom();
double middle = (top + bottom) / 2.0;
//set unit position
QRectF unitBox = m_unitText->boundingRect();
QRectF unitBox = m_unitText->alignmentRect();
double unitWidth = unitBox.width();
double unitRight = right + unitWidth;
// Set the m_unitText font *baseline* at same height as the m_dimText font baseline
m_unitText->setPos(right, 0.0);
//set tolerance position
QRectF overBox = m_tolTextOver->boundingRect();
QRectF overBox = m_tolTextOver->alignmentRect();
double tolLeft = unitRight;
// Adjust for difference in tight and original bounding box sizes, note the y-coord down system