Sketcher: modernize type checking

This commit is contained in:
Florian Foinant-Willig
2023-10-15 21:39:00 +02:00
parent cd403748f8
commit c0e8fa1e75
26 changed files with 352 additions and 406 deletions

View File

@@ -283,13 +283,13 @@ bool SnapManager::snapToObject(double& x, double& y)
}
// If it is a line, then we check if we need to snap to the middle.
if (geo->getTypeId() == Part::GeomLineSegment::getClassTypeId()) {
if (geo->is<Part::GeomLineSegment>()) {
const Part::GeomLineSegment* line = static_cast<const Part::GeomLineSegment*>(geo);
snapToLineMiddle(pointToOverride, line);
}
// If it is an arc, then we check if we need to snap to the middle (not the center).
if (geo->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) {
if (geo->is<Part::GeomArcOfCircle>()) {
const Part::GeomArcOfCircle* arc = static_cast<const Part::GeomArcOfCircle*>(geo);
snapToArcMiddle(pointToOverride, arc);
}