Fix late repaint of secondary views

- when ScaleType=Automatic and Scale changes
  individual views were not being repainted until
  next document recompute.
This commit is contained in:
wandererfan
2018-09-23 14:15:56 -04:00
committed by wmayer
parent e2c22ae98e
commit f2c6edbb19
2 changed files with 19 additions and 2 deletions

View File

@@ -103,6 +103,7 @@ void DrawProjGroup::onChanged(const App::Property* prop)
}
}
if (prop == &Scale) {
// Base::Console().Message("TRACE - DPG::onChanged(Scale) - %s\n",getNameInDocument());
updateChildren();
}
if (prop == &Source) {
@@ -110,6 +111,7 @@ void DrawProjGroup::onChanged(const App::Property* prop)
}
if (prop == &ScaleType) {
// Base::Console().Message("TRACE - DPG::onChanged(ScaleType) - %s\n",getNameInDocument());
double newScale = getScale();
if (ScaleType.isValue("Automatic")) {
//Recalculate scale if Group is too big or too small!
@@ -132,6 +134,7 @@ void DrawProjGroup::onChanged(const App::Property* prop)
App::DocumentObjectExecReturn *DrawProjGroup::execute(void)
{
// Base::Console().Message("TRACE - DPG::execute() - %s\n",getNameInDocument());
if (!keepUpdated()) {
return App::DocumentObject::StdReturn;
}
@@ -151,6 +154,10 @@ App::DocumentObjectExecReturn *DrawProjGroup::execute(void)
if (docObj == nullptr) {
return DrawViewCollection::execute();
}
for (auto& v: Views.getValues()) {
v->recomputeFeature();
}
for (auto& item: getViewsAsDPGI()) {
item->autoPosition();