-
Notifications
You must be signed in to change notification settings - Fork 3
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
Active line label overlaps with y=x, y=-x lines in long and rtl string tests #120
Comments
Thanks @rea-laura, I'll investigate. I was hoping that |
This problem is present on the Slope-Intercept and Point-Slope screens. I experimented with
|
I said:
To test this... In console.log( 'interactiveLineNode.equationNode.maxWidth=' + this.interactiveLineNode.equationNode.maxWidth ); And I modified standardLineAdded: function( line ) {
var lineNode = new LineNode( new Property( line ), this.model.graph, this.model.modelViewTransform,
{ equationType: this.equationType } );
console.log( 'standardLineAdded: line=' + line.toString() + ', lineNode.equationNode.maxWidth=' + lineNode.equationNode.maxWidth );
this.standardLinesParentNode.addChild( lineNode );
}, Start the sim, go to Slope-Intercept screen, 'y = x' checkbox checked. Console output is:
So |
Odd... If I move the interactive line from y=x, to y=0, then back to y=x, the problem (permanently!) goes away. The interactive equation then perfectly overlaps y=x (and y=-x). |
My next WAG is that SlopeInterceptEquationNode and PointSlopeEquationNode both have some subcomponent Node that is invisible, but whose default position is making the Node unnecessarily wide. And that setting the line to y=0 triggers a layout change that permanently resolves the issue. Equations on the graph are "dynamic", so start with |
My WAG in the preceding comment was correct. So this was easily fixed by fully resetting the location of all equation subcomponents (Nodes) whenever the equation updates, see commit above. A potential risk of this fix is that some equation is relying on the location of a previous update, and some part of the equation would be in the wrong location. I looked carefully at equations in Slope-Intercept, Point-Slope and Line Game screens (because this same code is used in Line Game), and I didn't see any issues. @rea-laura back to you to verify in master. If all looks OK, please leave this issue open for regression testing in 1.3.0-rc.2. |
To me this looks like the same issue as #114, as that only occurred with longer strings. |
@KatieWoe it's actually a subtly different issue. |
To verify this issue:
You could also do the above verification steps 1-7 for a RTL language, but |
Looks good on master. |
Pending regression testing in 1.3.0-rc.2. |
My apologies, the fix in 5478172 did not get cherry-picked into the 1.3 branch, so it's not in 1.3.0-rc.2. Please skip this we'll come back to it in a quick 1.3.0-rc.3. |
To verify this issue, follow the steps in #120 (comment). |
Fixed in both rcs |
Test Device
Leibniz
Operating System
iOS 12.1.3
Browser
Safari 12.1.3
Problem Description
For phetsims/qa#277:
When y=x or y=-x lines are activated and the interactive line is overlaid over these green lines, the labels overlap, but only on some string tests.
Steps to Reproduce
Visuals
Overlap (rtl and long):
No overlap (no string test, double, and X):
The text was updated successfully, but these errors were encountered: