DrawViewSymbol forgets Scale on restore

This commit is contained in:
WandererFan
2016-07-12 15:20:08 -04:00
parent 3dec1bd3b6
commit 21689507ea
3 changed files with 12 additions and 6 deletions

View File

@@ -70,7 +70,7 @@ DrawView::DrawView(void)
ScaleType.setEnums(ScaleTypeEnums);
ADD_PROPERTY_TYPE(ScaleType,((long)0),group, App::Prop_None, "Scale Type");
ADD_PROPERTY_TYPE(Scale ,(1.0),group,App::Prop_None,"Scale factor of the view");
Scale.setStatus(App::Property::ReadOnly,true);
//Scale.setStatus(App::Property::ReadOnly,true);
autoPos = true;
@@ -119,14 +119,15 @@ void DrawView::onChanged(const App::Property* prop)
TechDraw::DrawPage *page = findParentPage();
if(page) {
if(std::abs(page->Scale.getValue() - Scale.getValue()) > FLT_EPSILON) {
Scale.setValue(page->Scale.getValue()); // Recalculate scale from page
Scale.setValue(page->Scale.getValue()); // Reset scale from page
Scale.touch();
}
}
Scale.setStatus(App::Property::ReadOnly,true);
App::GetApplication().signalChangePropertyEditor(Scale);
} else if (ScaleType.isValue("Custom") &&
Scale.testStatus(App::Property::ReadOnly)) {
} else if ( ScaleType.isValue("Custom") ) {
// } else if (ScaleType.isValue("Custom") &&
// Scale.testStatus(App::Property::ReadOnly)) {
Scale.setStatus(App::Property::ReadOnly,false);
App::GetApplication().signalChangePropertyEditor(Scale);
}