[TD]fix over/under tolerance
- left justify tolerances - use format spec for tolerance == zero - prevent uncommanded tolerance format changes - use 'w' format for HoleShaftFit - allow zero tolerance values for HoleShaftFit
This commit is contained in:
@@ -275,20 +275,13 @@ void QGIDatumLabel::setPosFromCenter(const double& xCenter, const double& yCente
|
||||
|
||||
//set tolerance position
|
||||
QRectF overBox = m_tolTextOver->boundingRect();
|
||||
double overWidth = overBox.width();
|
||||
QRectF underBox = m_tolTextUnder->boundingRect();
|
||||
double underWidth = underBox.width();
|
||||
double width = underWidth;
|
||||
if (overWidth > underWidth) {
|
||||
width = overWidth;
|
||||
}
|
||||
double tolRight = unitRight + width;
|
||||
double tolLeft = unitRight;
|
||||
|
||||
// Adjust for difference in tight and original bounding box sizes, note the y-coord down system
|
||||
QPointF tol_adj = m_tolTextOver->tightBoundingAdjust();
|
||||
m_tolTextOver->justifyRightAt(tolRight + tol_adj.x(), middle - tol_adj.y(), false);
|
||||
m_tolTextOver->justifyLeftAt(tolLeft + tol_adj.x(), middle - tol_adj.y(), false);
|
||||
tol_adj = m_tolTextUnder->tightBoundingAdjust();
|
||||
m_tolTextUnder->justifyRightAt(tolRight + tol_adj.x(), middle + overBox.height() - tol_adj.y(),
|
||||
m_tolTextUnder->justifyLeftAt(tolLeft + tol_adj.x(), middle + overBox.height() - tol_adj.y(),
|
||||
false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user