Skip to content

Commit

Permalink
Fix X,Y of anchor in Projection Group
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan authored and yorikvanhavre committed Jun 15, 2018
1 parent f91cb2a commit 9e7f406
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/Mod/TechDraw/App/DrawProjGroupItem.cpp
Expand Up @@ -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());
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Mod/TechDraw/App/DrawProjGroupItem.h
Expand Up @@ -78,6 +78,7 @@ class TechDrawExport DrawProjGroupItem : public TechDraw::DrawViewPart

virtual double getScale(void) const override;
void autoPosition(void);
bool isAnchor(void);


protected:
Expand Down

0 comments on commit 9e7f406

Please sign in to comment.