-
Notifications
You must be signed in to change notification settings - Fork 7
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
Population graph layout issue with very long strings #210
Comments
Agree that this can be deferred for the prototype. I thought this might be a problem with the string that
... and the result was: So as the string gets longer, the Population graph is getting pushed more to the right. This also indicates that the current |
Note to self... Testing with |
This problem first appears in 1.1.0-dev.4. 1.1.0-dev.3 was published 2020-08-03 19:47. 1.1.0-dev.4 was published 2020-08-10 13:42. I suspect that it's related to the "Zoom in to see data" string, which may not have a |
Making the "Zoom to see data" string visible at all times confirms the problem, screenshot below. And looking at the code in PopulationGraphNode.js, I neglected to set a maxWidth: const zoomOutToSeeDataText = new Text( naturalSelectionStrings.zoomOutToSeeData, {
font: NaturalSelectionConstants.INSTRUCTIONS_FONT,
centerX: gridNode.x + gridWidth / 2,
centerY: gridNode.y + gridHeight / 2
} ); |
Here's a 1-line patch that fixes the problem. I'm going to wait to commit this until we decide when this issue should be addressed. patchIndex: js/common/view/population/PopulationGraphNode.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- js/common/view/population/PopulationGraphNode.js (revision 4b4266ed8b81d55958056710a5e8d8b8b75d9fec)
+++ js/common/view/population/PopulationGraphNode.js (date 1598582041505)
@@ -116,6 +116,7 @@
const zoomOutToSeeDataText = new Text( naturalSelectionStrings.zoomOutToSeeData, {
font: NaturalSelectionConstants.INSTRUCTIONS_FONT,
+ maxWidth: 0.75 * gridWidth,
centerX: gridNode.x + gridWidth / 2,
centerY: gridNode.y + gridHeight / 2
} ); |
This fix is almost zero risk. I recommend that we roll this fix into the prototype RC, and @ariel-phet approves. |
Fixed in the above commit and ready for verification. To verify in 1.1.0-rc.1:
|
Checked this out on the iPad and it looks good. I also made sure the "zoom in.." text showed up and it still looked good. |
Looks good, checked as phetsims/qa#540 Closing |
Discovered while performing string tests for phetsims/qa#539
With very long strings the population graph (but not the pedigree or proportion graph) gets very messed up in layout
I suspect there is something going on with the "generations" string on the bottom of the graph.
The sim passed all string tests, but this was noticed during
?stringTest=xss
(but passes for?stringTest=long
Although not a showstopper for the first release, this is probably good to fix for iO since a long string could potentially be put in place by an instructional designer
To reproduce:
The text was updated successfully, but these errors were encountered: