Manage rotated section views

This commit is contained in:
edi271
2023-04-05 13:17:48 +02:00
committed by WandererFan
parent c9d9284fb1
commit c9c82960ab

View File

@@ -1495,6 +1495,15 @@ void CmdTechDrawExtensionPositionSectionView::activated(int iMsg)
sectionView->Y.setValue(yPos);
else if ((direction == "Up") || (direction == "Down"))
sectionView->X.setValue(xPos);
else if (direction == "Aligned")
{
Base::Vector3d pBase(xPos,yPos,0.0);
Base::Vector3d dirView(sectionView->Direction.getValue());
Base::Vector3d pSection(sectionView->X.getValue(),sectionView->Y.getValue(),0.0);
Base::Vector3d newPos = DrawUtil::getTrianglePoint(pBase, dirView, pSection);
sectionView->X.setValue(newPos.x);
sectionView->Y.setValue(newPos.y);
}
}
}