Merge pull request #1377 from SiboVG/issue-1375

[#1375] Fix preset not "resetting" nose cone / transition shape parameter
This commit is contained in:
SiboVG 2022-05-25 16:56:21 +02:00 committed by GitHub
commit c4ffc663bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);