[#1375] Fix preset not "resetting" nose cone / transition shape parameter

This commit is contained in:
SiboVG 2022-05-25 16:54:32 +02:00
parent 586b85e536
commit a526b18626

View File

@ -257,7 +257,7 @@ public class Transition extends SymmetricComponent implements InsideColorCompone
if (type == null) { if (type == null) {
throw new IllegalArgumentException("setType called with null argument"); throw new IllegalArgumentException("setType called with null argument");
} }
if (this.type == type) if ((this.type == type) && (this.clipped == type.isClippable()) && (this.shapeParameter == type.defaultParameter()))
return; return;
this.type = type; this.type = type;
this.clipped = type.isClippable(); this.clipped = type.isClippable();
@ -284,7 +284,7 @@ public class Transition extends SymmetricComponent implements InsideColorCompone
return; return;
this.shapeParameter = MathUtil.clamp(n, type.minParameter(), type.maxParameter()); this.shapeParameter = MathUtil.clamp(n, type.minParameter(), type.maxParameter());
// Need to clearPreset when shape type changes. // Need to clearPreset when shape parameter changes.
clearPreset(); clearPreset();
fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE); fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE);