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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user