[TD]fix extension Extend function re scale/rotate
This commit is contained in:
@@ -1475,10 +1475,16 @@ void execExtendShortenLine(Gui::Command* cmd, bool extend)
|
||||
TechDraw::BaseGeomPtr baseGeo = objFeat->getGeomByIndex(num);
|
||||
if (baseGeo) {
|
||||
if (baseGeo->getGeomType() == TechDraw::GENERIC) {
|
||||
TechDraw::GenericPtr genLine =
|
||||
std::static_pointer_cast<TechDraw::Generic>(baseGeo);
|
||||
Base::Vector3d P0 = genLine->points.at(0);
|
||||
Base::Vector3d P1 = genLine->points.at(1);
|
||||
// start and end points are scaled and rotated. invert the points
|
||||
// so the canonicalPoint math works correctly.
|
||||
Base::Vector3d P0 = DU::invertY(baseGeo->getStartPoint());
|
||||
Base::Vector3d P1 = DU::invertY(baseGeo->getEndPoint());
|
||||
// convert start and end to unscaled, unrotated.
|
||||
P0 = CosmeticVertex::makeCanonicalPoint(objFeat, P0);
|
||||
P1 = CosmeticVertex::makeCanonicalPoint(objFeat, P1);
|
||||
// put the points back into weird Qt coord system.
|
||||
P0 = DU::invertY(P0);
|
||||
P1 = DU::invertY(P1);
|
||||
bool isCenterLine = false;
|
||||
TechDraw::CenterLine* centerEdge = nullptr;
|
||||
if (baseGeo->getCosmetic()) {
|
||||
@@ -1499,7 +1505,7 @@ void execExtendShortenLine(Gui::Command* cmd, bool extend)
|
||||
isCenterLine = true;
|
||||
centerEdge = objFeat->getCenterLine(uniTag);
|
||||
}
|
||||
double scale = objFeat->getScale();
|
||||
// double scale = objFeat->getScale();
|
||||
Base::Vector3d direction = (P1 - P0).Normalize();
|
||||
Base::Vector3d delta = direction * activeDimAttributes.getLineStretch();
|
||||
Base::Vector3d startPt, endPt;
|
||||
@@ -1519,7 +1525,7 @@ void execExtendShortenLine(Gui::Command* cmd, bool extend)
|
||||
}
|
||||
else {
|
||||
std::string lineTag =
|
||||
objFeat->addCosmeticEdge(startPt / scale, endPt / scale);
|
||||
objFeat->addCosmeticEdge(startPt, endPt);
|
||||
TechDraw::CosmeticEdge* lineEdge = objFeat->getCosmeticEdge(lineTag);
|
||||
_setLineAttributes(lineEdge, oldStyle, oldWeight, oldColor);
|
||||
objFeat->refreshCEGeoms();
|
||||
|
||||
Reference in New Issue
Block a user