[TD]fix BrokenView dimensions

This commit is contained in:
wandererfan
2024-04-15 10:16:23 -04:00
committed by WandererFan
parent 4f4df89442
commit 41bce2eaf4
3 changed files with 232 additions and 104 deletions

View File

@@ -649,14 +649,16 @@ double DrawViewDimension::getDimValue()
return result;
}
if (Type.isValue("Distance") || Type.isValue("DistanceX") || Type.isValue("DistanceY")) {
// linear points are inverted? +Y down? scaled!
pointPair pts = getLinearPoints();
auto dbv = dynamic_cast<DrawBrokenView*>(getViewPart());
if (dbv) {
// pts are inverted Y, so we need to un-invert them before mapping
// pts are scaled, so we need to unscale them for mapPoint2dFromView
// raw pts from view are inverted Y, so we need to un-invert them before mapping
// raw pts are scaled, so we need to unscale them for mapPoint2dFromView
// then rescale them for the distance calculation below
// centers are right side up
// if both points are on the expanded side of the last (rightmost/upmost) break
// then we should not move the points.
//
pts.invertY();
pts.scale(1.0 / getViewPart()->getScale());
pts.first(dbv->mapPoint2dFromView(pts.first()));