Open pixelzoom opened 2 hours ago
Related to https://github.com/phetsims/equality-explorer/issues/187 ...
There's a dynamic layout problem with the equations (EquationNode) in the Solve It! screen, reproducible with ?stringTest=dynamic. For example:
?stringTest=dynamic
I thought the patch below would resolve the problem, but it results in a new layout problem:
This is a problem anywhere that a dynamic string appears on the lefthand side of the equation. For example, in the Variables screen:
Related to https://github.com/phetsims/equality-explorer/issues/187 ...
There's a dynamic layout problem with the equations (EquationNode) in the Solve It! screen, reproducible with
?stringTest=dynamic
. For example:I thought the patch below would resolve the problem, but it results in a new layout problem:
patch
```diff Subject: [PATCH] set maxWidth and minContentWidth for SnapshotsAccordionBox content, https://github.com/phetsims/equality-explorer/issues/207 --- Index: js/common/view/EquationNode.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/js/common/view/EquationNode.ts b/js/common/view/EquationNode.ts --- a/js/common/view/EquationNode.ts (revision e5daa6801b1324a001c6ca82dcbee4d48d33ae99) +++ b/js/common/view/EquationNode.ts (date 1731857148487) @@ -163,7 +163,8 @@ this.leftExpressionNode = new ExpressionNode( this.leftTermCreators, this.expressionNodeOptions ); this.rightExpressionNode = new ExpressionNode( this.rightTermCreators, this.expressionNodeOptions ); this.children = [ this.leftExpressionNode, this.relationalOperatorText, this.rightExpressionNode ]; - this.updateLayout(); + Multilink.multilink( [ this.leftExpressionNode.localBoundsProperty, this.rightExpressionNode.localBoundsProperty ], + () => this.updateLayout() ); } /** @@ -171,7 +172,7 @@ */ private updateRelationalOperator(): void { this.relationalOperatorText.string = getRelationalOperator( this.leftTermCreators, this.rightTermCreators ); - this.updateLayout(); + this.relationalOperatorText.localBoundsProperty.link( () => this.updateLayout() ); } /** ```