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

@@ -229,10 +229,19 @@ void TaskProjGroup::scaleTypeChanged(int index)
, "Page");
} else if(index == 1) {
// Automatic Scale Type
Gui::Command::doCommand(Gui::Command::Doc, "App.activeDocument().%s.ScaleType = '%s'", multiView->getNameInDocument()
, "Automatic");
// Gui::Command::doCommand(Gui::Command::Doc, "App.activeDocument().%s.ScaleType = '%s'", multiView->getNameInDocument()
// , "Automatic");
// Base::Console().Message("TRACE - TPG::scaleTypeChanged - Auto\n");
//block recompute
multiView->ScaleType.setValue("Automatic");
double autoScale = multiView->calculateAutomaticScale();
multiView->Scale.setValue(autoScale);
//unblock recompute
// Base::Console().Message("TRACE - TPG::scaleTypeChanged - autoScale: %.3f\n",autoScale);
} else if(index == 2) {
// Custom Scale Type
//block recompute
Gui::Command::doCommand(Gui::Command::Doc, "App.activeDocument().%s.ScaleType = '%s'", multiView->getNameInDocument()
, "Custom");
ui->sbScaleNum->setEnabled(true);
@@ -243,6 +252,7 @@ void TaskProjGroup::scaleTypeChanged(int index)
double scale = (double) a / (double) b;
Gui::Command::doCommand(Gui::Command::Doc, "App.activeDocument().%s.Scale = %f", multiView->getNameInDocument()
, scale);
//unblock recompute
} else {
Base::Console().Log("Error - TaskProjGroup::scaleTypeChanged - unknown scale type: %d\n",index);
return;