BlendCurve: fix auto-update of properties

This commit is contained in:
tomate44
2023-08-30 22:13:35 +02:00
committed by wwmayer
parent e1b139655f
commit 34634ac3cf
2 changed files with 6 additions and 10 deletions

View File

@@ -158,18 +158,15 @@ double FeatureBlendCurve::RelativeToRealParameters(double relativeValue, double
void FeatureBlendCurve::onChanged(const App::Property *prop)
{
if (prop == &StartContinuity) {
auto changedStartProp = dynamic_cast<const App::PropertyInteger *>(prop);
if (changedStartProp->getValue() > (maxDegree - 2 - EndContinuity.getValue())) {
StartContinuity.setValue(maxDegree - 2 - EndContinuity.getValue());
long maxValue = maxDegree - 2 - EndContinuity.getValue();
if (StartContinuity.getValue() > maxValue) {
StartContinuity.setValue(maxValue);
}
}
else if (prop == &EndContinuity) {
auto changedEndProp = dynamic_cast<const App::PropertyInteger *>(prop);
if (changedEndProp->getValue() > (maxDegree - 2 - StartContinuity.getValue())) {
EndContinuity.setValue(maxDegree - 2 - StartContinuity.getValue());
long maxValue = maxDegree - 2 - StartContinuity.getValue();
if (EndContinuity.getValue() > maxValue) {
EndContinuity.setValue(maxValue);
}
}
if (prop == &StartContinuity || prop == &StartParameter || prop == &StartSize || prop == &EndContinuity || prop == &EndParameter || prop == &EndSize) {

View File

@@ -63,7 +63,6 @@ public:
private:
BlendPoint GetBlendPoint(App::PropertyLinkSub &link, App::PropertyFloatConstraint &param, App::PropertyIntegerConstraint &Continuity);
double RelativeToRealParameters(double, double, double);
bool lockOnChangeMutex{false};
protected:
void onChanged(const App::Property *prop) override;