[TD]prevent loop with AutoScale

This commit is contained in:
wandererfan
2020-03-29 13:04:47 -04:00
committed by WandererFan
parent d365435b90
commit 96b85abcc8

View File

@@ -116,6 +116,9 @@ void DrawView::checkScale(void)
void DrawView::onChanged(const App::Property* prop)
{
//Coding note: calling execute, recompute or recomputeFeature inside an onChanged
//method can create infinite loops. In general don't do this! There may be
//situations where it is OK, but careful analysis is a must.
if (!isRestoring()) {
if (prop == &ScaleType) {
auto page = findParentPage();
@@ -144,14 +147,9 @@ void DrawView::onChanged(const App::Property* prop)
handleXYLock();
LockPosition.purgeTouched();
}
if ((prop == &Caption) ||
(prop == &Label)) {
requestPaint();
} // rotation and scaling requires recompute
else if ((prop == &Rotation) ||
(prop == &Scale) ||
(prop == &ScaleType)) {
recompute();
if ((prop == &Caption) ||
(prop == &Label)) {
requestPaint();
}
}
App::DocumentObject::onChanged(prop);