-
Notifications
You must be signed in to change notification settings - Fork 4
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
With some string tests moving Reference Line causes buttons/graphs to move #304
Comments
Identical weirdness occurs with the Reference Line scrubber and the "Net Signed Area" accordion box in the Integral screen. Only the Reference Line scrubber causes this; no such weirdness occurs with the other scrubbers. "Slope of Tangent" accordion box is positioned dynamically in DerivativeScreenView.ts: // Center slopeOfTangentAccordionBox in the negative space to the left of graphNode, top-aligned with graphNode.y.
this.graphsNode.boundsProperty.link( () => {
slopeOfTangentAccordionBox.centerX = this.layoutBounds.left + ( this.graphsNode.left - this.layoutBounds.left ) / 2;
slopeOfTangentAccordionBox.top = this.graphsNode.y + this.graphsNode.originalGraphNode.y;
} ); "Net Signed Area" accordion box is positioned dynamically in IntegralScreenView.ts: // Center netSignedAreaAccordionBox in the negative space to the left of graphNode, top-aligned with graphNode.y.
this.graphsNode.boundsProperty.link( () => {
netSignedAreaAccordionBox.centerX = this.layoutBounds.left + ( this.graphsNode.left - this.layoutBounds.left ) / 2;
netSignedAreaAccordionBox.top = this.graphsNode.y + this.graphsNode.originalGraphNode.y;
} ); |
Adding this to DerivativeScreenView.ts: this.graphsNode.boundsProperty.link( () => {
+ console.log( `this.graphsNode.left=${this.graphsNode.left}` );
slopeOfTangentAccordionBox.centerX = this.layoutBounds.left + ( this.graphsNode.left - this.layoutBounds.left ) / 2;
slopeOfTangentAccordionBox.top = this.graphsNode.y + this.graphsNode.originalGraphNode.y;
} ); ... I can see that |
Fixed in the above commits by setting a maxWidth for the "x = {{number}}" value that the Reference Line displays. Screenshot below is with @Nancy-Salpepi please verify in master, close if OK. |
@pixelzoom things are much improved! There is still a teeny tiny bit of movement. It is easier to see with rtl --looking at the title text: slightmovement.mp4 |
I also noticed something odd happening on the right side of the screen with stringTest=long. I am including it here because I think it might be the same issue:
sideofpanel.mp4 |
I'll have a look. I made a maxWidth a very generous value, and can definitely reduce it. |
Reducing maxWidth isn't going to resolve this. The scenario that @Nancy-Salpepi described in #304 (comment) is a problem even without stringTest=long. Following the same steps with Relevant code in CalculusGrapherScreenView.ts: // Put control panel in the negative space to the right of graphsNode, top-aligned with graphsNode.y.
rightVBox.boundsProperty.link( () => {
rightVBox.centerX = this.layoutBounds.right - ( this.layoutBounds.right - this.graphsNode.right ) / 2;
rightVBox.top = this.graphsNode.y;
} ); |
In the above commits, I fixed dynamic positioning of the following things:
Please test with Over to @Nancy-Salpepi for verification, close if OK. And thanks for discovering this! |
This looks good with stringTest=long, stringTest=rtl, and no stringTest. Closing! |
Test device
MacBook Air (m1 chip)
Operating System
13.2.1
Browser
safari/chrome
Problem description
For phetsims/qa#921, with stringTest=long and stringTest=rtl:
When the Reference Line is moved to the left, the graph/buttons on the left side of the screen also move.
Steps to reproduce
On the Derivative and Integral Screens:
On the Advanced and Lab Screens:
Visuals
thingsmove.mp4
The text was updated successfully, but these errors were encountered: