+ in Fem constraint force dialog handle empty Direction

This commit is contained in:
wmayer
2015-02-27 23:27:08 +01:00
parent 6721139630
commit 20c367f2dc
2 changed files with 15 additions and 3 deletions

View File

@@ -96,8 +96,11 @@ void ConstraintForce::onChanged(const App::Property* prop)
} else if (prop == &NormalDirection) {
// Set a default direction if no direction reference has been given
if (Direction.getValue() == NULL) {
DirectionVector.setValue(NormalDirection.getValue());
naturalDirectionVector = NormalDirection.getValue();
Base::Vector3d direction = NormalDirection.getValue();
if (Reversed.getValue())
direction = -direction;
DirectionVector.setValue(direction);
naturalDirectionVector = direction;
}
}
}