Sketcher/BackEdit: makes clip plane switch side according to view side

This commit is contained in:
0penBrain
2022-08-31 09:55:31 +02:00
committed by wwmayer
parent 77f83ce716
commit 968fb5be34
3 changed files with 18 additions and 3 deletions

View File

@@ -964,7 +964,17 @@ CmdSketcherViewSection::CmdSketcherViewSection()
void CmdSketcherViewSection::activated(int iMsg)
{
Q_UNUSED(iMsg);
doCommand(Doc,"ActiveSketch.ViewObject.TempoVis.sketchClipPlane(ActiveSketch)");
QString cmdStr = QLatin1String("ActiveSketch.ViewObject.TempoVis.sketchClipPlane(ActiveSketch, None, %1)\n");
Gui::Document *doc = getActiveGuiDocument();
bool revert = false;
if(doc) {
SketcherGui::ViewProviderSketch* vp = dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit());
if (vp) {
revert = vp->getViewOrientationFactor() < 0?true:false;
}
}
cmdStr = cmdStr.arg(revert?QLatin1String("True"):QLatin1String("False"));
doCommand(Doc, cmdStr.toLatin1());
}
bool CmdSketcherViewSection::isActive()