Skip to content

Commit

Permalink
simplify derivation of isOpenProperty, #212
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Dec 15, 2023
1 parent c8de0ea commit 1902bbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/common/model/IdealGasLawContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export default class IdealGasLawContainer extends BaseContainer {
this.previousLeft = this.left;

this.isOpenProperty = new DerivedProperty(
[ this.lidIsOnProperty, this.lidWidthProperty, this.boundsProperty ],
( lidIsOn, lidWidth, bounds ) => !lidIsOn || this.getOpeningWidth() !== 0
[ this.lidIsOnProperty, this.lidWidthProperty ],
( lidIsOn, lidWidth ) => !lidIsOn || ( lidWidth < this.getMaxLidWidth() )
);
}

Expand Down

0 comments on commit 1902bbb

Please sign in to comment.