Fix View positioning for Automatic scaling
This commit is contained in:
parent
7c6d92238a
commit
bd13d33937
|
@ -533,6 +533,7 @@ bool DrawProjGroup::distributeProjections()
|
|||
return true;
|
||||
}
|
||||
|
||||
//!allow child DPGI's to be automatically positioned
|
||||
void DrawProjGroup::resetPositions(void)
|
||||
{
|
||||
const std::vector<App::DocumentObject *> &views = Views.getValues();
|
||||
|
@ -540,6 +541,7 @@ void DrawProjGroup::resetPositions(void)
|
|||
DrawView *view = dynamic_cast<DrawView *>(*it);
|
||||
if(view->getTypeId() == DrawProjGroupItem::getClassTypeId()) {
|
||||
view->setAutoPos(true);
|
||||
//X,Y == 0??
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -571,21 +573,19 @@ App::DocumentObjectExecReturn *DrawProjGroup::execute(void)
|
|||
// Set this Scale
|
||||
Scale.setValue(autoScale);
|
||||
|
||||
//Rebuild the view
|
||||
//Rebuild the DPGI's
|
||||
const std::vector<App::DocumentObject *> &views = Views.getValues();
|
||||
for(std::vector<App::DocumentObject *>::const_iterator it = views.begin(); it != views.end(); ++it) {
|
||||
App::DocumentObject *docObj = *it;
|
||||
if(docObj->getTypeId().isDerivedFrom(DrawView::getClassTypeId())) {
|
||||
DrawView *view = dynamic_cast<DrawView *>(*it);
|
||||
|
||||
//Set scale factor of each view
|
||||
if(docObj->getTypeId().isDerivedFrom(DrawProjGroupItem::getClassTypeId())) {
|
||||
DrawProjGroupItem *view = dynamic_cast<DrawProjGroupItem *>(*it);
|
||||
view->ScaleType.setValue("Custom");
|
||||
view->Scale.setValue(autoScale);
|
||||
view->Scale.touch();
|
||||
view->Scale.setStatus(App::Property::ReadOnly,true);
|
||||
view->touch();
|
||||
}
|
||||
}
|
||||
resetPositions();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
virtual PyObject *getPyObject(void);
|
||||
|
||||
DrawPage* findParentPage() const;
|
||||
bool allowAutoPos() {return autoPos;};
|
||||
bool allowAutoPos() {return autoPos;}; //sb in DPGI??
|
||||
void setAutoPos(bool state) {autoPos = state;};
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in New Issue
Block a user