Allow ProgGroup Item AutoPosition from Python

This commit is contained in:
WandererFan
2018-02-11 20:07:57 +01:00
committed by wmayer
parent 1909466241
commit 4f291f7305
9 changed files with 70 additions and 27 deletions
+13 -7
View File
@@ -99,17 +99,23 @@ App::DocumentObjectExecReturn *DrawProjGroupItem::execute(void)
App::DocumentObjectExecReturn * ret = DrawViewPart::execute();
delete ret;
autoPosition();
requestPaint();
return App::DocumentObject::StdReturn;
}
void DrawProjGroupItem::autoPosition()
{
auto pgroup = getPGroup();
Base::Vector3d newPos;
if ((pgroup != nullptr) &&
(pgroup->AutoDistribute.getValue())) {
newPos = pgroup->getXYPosition(Type.getValueAsString());
X.setValue(newPos.x);
Y.setValue(newPos.y);
requestPaint();
(pgroup->AutoDistribute.getValue()) &&
(!LockPosition.getValue())) {
newPos = pgroup->getXYPosition(Type.getValueAsString());
X.setValue(newPos.x);
Y.setValue(newPos.y);
}
return App::DocumentObject::StdReturn;
}
void DrawProjGroupItem::onDocumentRestored()