Sketcher: AutoColor should update only colors
Previously AutoColor property forced reinitialization of all subscribed parameters. It was mostly fine as most of them should stay in sync with user settings but it also affected grids.
This commit is contained in:
committed by
Chris Hennes
parent
a3f8483032
commit
7646d4b611
@@ -401,7 +401,13 @@ void ViewProviderSketch::ParameterObserver::OnChange(Base::Subject<const char*>&
|
||||
{
|
||||
(void)rCaller;
|
||||
|
||||
auto key = parameterMap.find(sReason);
|
||||
updateFromParameter(sReason);
|
||||
}
|
||||
|
||||
void SketcherGui::ViewProviderSketch::ParameterObserver::updateFromParameter(const char* parameter)
|
||||
{
|
||||
auto key = parameterMap.find(parameter);
|
||||
|
||||
if (key != parameterMap.end()) {
|
||||
auto string = key->first;
|
||||
auto update = std::get<0>(key->second);
|
||||
@@ -2976,7 +2982,8 @@ void SketcherGui::ViewProviderSketch::finishRestoring()
|
||||
|
||||
if (AutoColor.getValue()) {
|
||||
// update colors according to current user preferences
|
||||
pObserver->initParameters();
|
||||
pObserver->updateFromParameter("SketchEdgeColor");
|
||||
pObserver->updateFromParameter("SketchVertexColor");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -174,6 +174,8 @@ private:
|
||||
/** Observer for parameter group. */
|
||||
void OnChange(Base::Subject<const char*>& rCaller, const char* sReason) override;
|
||||
|
||||
void updateFromParameter(const char* property);
|
||||
|
||||
private:
|
||||
void
|
||||
updateBoolProperty(const std::string& string, App::Property* property, bool defaultvalue);
|
||||
|
||||
Reference in New Issue
Block a user