Fix X,Y of anchor in Projection Group

This commit is contained in:
wandererfan
2018-06-13 17:39:18 -04:00
committed by Yorik van Havre
parent 3d0a49ddc3
commit 5efe63c06a
2 changed files with 19 additions and 1 deletions

View File

@@ -109,7 +109,10 @@ void DrawProjGroupItem::autoPosition()
{
auto pgroup = getPGroup();
Base::Vector3d newPos;
if ((pgroup != nullptr) &&
if (isAnchor()) {
X.setValue(0.0);
Y.setValue(0.0);
} else if ((pgroup != nullptr) &&
(pgroup->AutoDistribute.getValue()) &&
(!LockPosition.getValue())) {
newPos = pgroup->getXYPosition(Type.getValueAsString());
@@ -138,6 +141,20 @@ DrawProjGroup* DrawProjGroupItem::getPGroup() const
}
return result;
}
bool DrawProjGroupItem::isAnchor(void)
{
bool result = false;
auto group = getPGroup();
if (group != nullptr) {
DrawProjGroupItem* anchor = group->getAnchor();
if (anchor == this) {
result = true;
}
}
return result;
}
gp_Ax2 DrawProjGroupItem::getViewAxis(const Base::Vector3d& pt,
const Base::Vector3d& axis,
const bool flip) const

View File

@@ -78,6 +78,7 @@ public:
virtual double getScale(void) const override;
void autoPosition(void);
bool isAnchor(void);
protected: