Fix double scaling in DPG AutoScale

This commit is contained in:
wandererfan
2018-09-23 15:03:11 -04:00
committed by wmayer
parent 3163c3d6f5
commit 859fed207d
3 changed files with 11 additions and 20 deletions

View File

@@ -112,10 +112,7 @@ void DrawView::checkScale(void)
void DrawView::onChanged(const App::Property* prop)
{
if (!isRestoring()) {
if ((this->isDerivedFrom(TechDraw::DrawProjGroupItem::getClassTypeId())) ||
(this->isDerivedFrom(TechDraw::DrawProjGroup::getClassTypeId()))) {
//do nothing. DPGI/DPG handles itself
} else if (prop == &ScaleType) {
if (prop == &ScaleType) {
auto page = findParentPage();
if (ScaleType.isValue("Page")) {
Scale.setStatus(App::Property::ReadOnly,true);
@@ -133,18 +130,15 @@ void DrawView::onChanged(const App::Property* prop)
} else if ( ScaleType.isValue("Automatic") ) {
Scale.setStatus(App::Property::ReadOnly,true);
App::GetApplication().signalChangePropertyEditor(Scale);
if (this->isDerivedFrom(TechDraw::DrawProjGroup::getClassTypeId())) {
//do nothing. DPG handles itself
} else {
if (!checkFit(page)) {
double newScale = autoScale(page->getPageWidth(),page->getPageHeight());
if(std::abs(newScale - getScale()) > FLT_EPSILON) { //stops onChanged/execute loop
Scale.setValue(newScale);
Scale.purgeTouched();
}
if (!checkFit(page)) {
double newScale = autoScale(page->getPageWidth(),page->getPageHeight());
if(std::abs(newScale - getScale()) > FLT_EPSILON) { //stops onChanged/execute loop
Scale.setValue(newScale);
Scale.purgeTouched();
}
}
}
}
// }
}
if (prop == &X || //nothing needs to be calculated, just the graphic needs to be shifted.
prop == &Y) {