-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CT: Assertion failed: openingLeft must be <= openingRight #212
Comments
The failure occurs in IdealGasLawContainer public getOpeningLeft(): number {
let openingLeft = null;
if ( this.lidIsOnProperty.value ) {
openingLeft = this.left - this.wallThickness + this.lidWidthProperty.value;
// Round to nearest pm to avoid floating-point error, see https://github.com/phetsims/gas-properties/issues/63
openingLeft = Utils.roundSymmetric( openingLeft );
}
else {
openingLeft = this.left + this.openingLeftInset;
}
assert && assert( openingLeft <= this.getOpeningRight(),
`openingLeft ${openingLeft} must be <= openingRight ${this.getOpeningRight()}, lidIsOn=${this.lidIsOnProperty.value}` );
return openingLeft;
} So this.isOpenProperty = new DerivedProperty(
[ this.lidIsOnProperty, this.lidWidthProperty, this.boundsProperty ],
( lidIsOn, lidWidth, bounds ) => !lidIsOn || this.getOpeningWidth() !== 0
); |
IdealGasLawContainerNode.ts confirms that the lid is being put on ( container.lidIsOnProperty.link( lidIsOn => {
if ( lidIsOn ) {
// restore the lid to the fully-closed position
container.lidWidthProperty.value = container.getMaxLidWidth(); |
Fixed in the above commit by simplifying the derivation of |
CT looks good. Closing. |
After addressing missing dependencies in #211 and phetsims/axon#441, CT is now reporting:
The text was updated successfully, but these errors were encountered: