Prevent Loop in BRepBuilderAPI_Transform

- if a scale transform with scale = 0 is passed to
  BRepBuilderAPI_Transform, it will loop forever.
  If Page.keepUpdated is false, and Views have not yet
  been executed (ex at load time), Views will have a
  0.0 x 0.0 bbox and if Autoscale is true, a scale of
  0.0 will be used in fit-to-page.
This commit is contained in:
WandererFan
2018-02-01 15:46:01 -05:00
parent d2e331146b
commit d7544b4223
5 changed files with 24 additions and 2 deletions

View File

@@ -183,6 +183,10 @@ double DrawProjGroupItem::getScale(void) const
auto pgroup = getPGroup();
if (pgroup != nullptr) {
result = pgroup->Scale.getValue();
if (!(result > 0.0)) {
Base::Console().Log("DPGI - %s - bad scale found (%.3f) using 1.0\n",getNameInDocument(),Scale.getValue());
result = 1.0; //kludgy protective fix. autoscale sometimes serves up 0.0!
}
}
return result;
}