Merge pull request #27134 from WandererFan/CosCircleLineStyle2

TechDraw: Fix circle centerline default line style
This commit is contained in:
Chris Hennes
2026-01-29 13:14:39 +01:00
committed by GitHub

View File

@@ -215,20 +215,25 @@ void execCircleCenterLines(Gui::Command* cmd)
double radius = cgen->radius / objFeat->getScale();
// right, left, top, bottom are formed from a canonical point (center)
// so they do not need to be changed to canonical form.
Base::Vector3d right(center.x + radius + 2.0, center.y, 0.0);
Base::Vector3d top(center.x, center.y + radius + 2.0, 0.0);
Base::Vector3d left(center.x - radius - 2.0, center.y, 0.0);
Base::Vector3d bottom(center.x, center.y - radius - 2.0, 0.0);
constexpr double lineOutsideCircle{2.0};
Base::Vector3d right(center.x + radius + lineOutsideCircle, center.y, 0.0);
Base::Vector3d top(center.x, center.y + radius + lineOutsideCircle, 0.0);
Base::Vector3d left(center.x - radius - lineOutsideCircle, center.y, 0.0);
Base::Vector3d bottom(center.x, center.y - radius - lineOutsideCircle, 0.0);
std::string line1tag = objFeat->addCosmeticEdge(right, left);
std::string line2tag = objFeat->addCosmeticEdge(top, bottom);
TechDraw::CosmeticEdge* horiz = objFeat->getCosmeticEdge(line1tag);
_setLineAttributes(horiz);
TechDraw::CosmeticEdge* vert = objFeat->getCosmeticEdge(line2tag);
_setLineAttributes(vert);
// horiz & vert are centerlines, so they should use the default centerline
// number and not the number from line attributes
horiz->m_format.setLineNumber(Preferences::CenterLineStyle());
vert->m_format.setLineNumber(Preferences::CenterLineStyle());
}
}
}
cmd->getSelection().clearSelection();
Gui::Selection().clearCompleteSelection();
objFeat->refreshCEGeoms();
objFeat->requestPaint();
Gui::Command::commitCommand();