Skip to content

Commit

Permalink
Part: Recalculate tessellation when requested
Browse files Browse the repository at this point in the history
  • Loading branch information
ickby committed Apr 12, 2016
1 parent 5f45bcb commit 788035b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/Mod/Part/Gui/ViewProviderExt.cpp
Expand Up @@ -325,11 +325,19 @@ ViewProviderPartExt::~ViewProviderPartExt()

void ViewProviderPartExt::onChanged(const App::Property* prop)
{
Part::Feature* feature = dynamic_cast<Part::Feature*>(pcObject);

if (prop == &Deviation) {
VisualTouched = true;
if(Visibility.getValue() && feature && !feature->Shape.getValue().IsNull())
updateVisual(feature->Shape.getValue());
else
VisualTouched = true;
}
if (prop == &AngularDeflection) {
VisualTouched = true;
if(Visibility.getValue() && feature && !feature->Shape.getValue().IsNull())
updateVisual(feature->Shape.getValue());
else
VisualTouched = true;
}
if (prop == &LineWidth) {
pcLineStyle->lineWidth = LineWidth.getValue();
Expand Down Expand Up @@ -479,7 +487,7 @@ void ViewProviderPartExt::onChanged(const App::Property* prop)
else {
// if the object was invisible and has been changed, recreate the visual
if (prop == &Visibility && Visibility.getValue() && VisualTouched) {
updateVisual(dynamic_cast<Part::Feature*>(pcObject)->Shape.getValue());
updateVisual(feature->Shape.getValue());
// The material has to be checked again (#0001736)
onChanged(&DiffuseColor);
}
Expand Down

0 comments on commit 788035b

Please sign in to comment.