Part: Revolution: do not copy style of sketches

This commit is contained in:
PaddleStroke
2025-09-05 15:37:55 +02:00
committed by GitHub
parent a32466fc40
commit de607c1c30

View File

@@ -49,6 +49,8 @@
#include <Gui/WaitCursor.h>
#include <Mod/Part/App/FeatureRevolution.h>
#include <Mod/Part/App/Part2DObject.h>
#include "DlgRevolution.h"
#include "ui_DlgRevolution.h"
@@ -434,11 +436,15 @@ void DlgRevolution::accept()
symmetric) //%13
;
Gui::Command::runCommand(Gui::Command::App, code.toLatin1());
QByteArray to = name.toLatin1();
QByteArray from = shape.toLatin1();
Gui::Command::copyVisual(to, "ShapeAppearance", from);
Gui::Command::copyVisual(to, "LineColor", from);
Gui::Command::copyVisual(to, "PointColor", from);
auto newObj = activeDoc->getObject(name.toStdString().c_str());
auto sourceObj = activeDoc->getObject(shape.toStdString().c_str());
if (!sourceObj->isDerivedFrom<Part::Part2DObject>()) {
Gui::Command::copyVisual(newObj, "ShapeAppearance", sourceObj);
Gui::Command::copyVisual(newObj, "LineColor", sourceObj);
Gui::Command::copyVisual(newObj, "PointColor", sourceObj);
}
}
activeDoc->commitTransaction();
@@ -585,3 +591,4 @@ bool TaskRevolution::accept()
}
#include "moc_DlgRevolution.cpp"