Skip to content
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

Assertion failed: rightCenter should be a finite Vector2 #342

Open
zepumph opened this issue Jan 9, 2025 · 3 comments
Open

Assertion failed: rightCenter should be a finite Vector2 #342

zepumph opened this issue Jan 9, 2025 · 3 comments

Comments

@zepumph
Copy link
Member

zepumph commented Jan 9, 2025

Caused from layout updates when locale changes AND phet-io fuzzing hides all checkboxes in this vertical checkbox group:

// Update the layout to support dynamic locale
Multilink.multilink( [ sumOfForcesStringProperty, valuesStringProperty, speedStringProperty ], () => {
verticalCheckboxGroupPanel.right = ForcesAndMotionBasicsLayoutBounds.width - 5;
this.resetAllButton.rightCenter = verticalCheckboxGroupPanel.rightBottom.plusXY( -BUTTON_PADDING, 35 );
} );

@zepumph
Copy link
Member Author

zepumph commented Jan 9, 2025

To reproduce:

  • FAMB is studio
  • Toggle forcesAndMotionBasics.netForceScreen.view.controlPanel.verticalCheckboxGroup.visibleProperty to false
  • Change the locale.

This doesn't happen on any other screens. Multilink was added in c69d3fd

@zepumph
Copy link
Member Author

zepumph commented Jan 9, 2025

This is not really too good of a solution, but the layout code to begin with isn't really that great either. Some thoughts on this block:

  1. We don't listen to bounds, only the string itself, so many other items could effect the panel (hiding one checkbox with PhET-iO) and this wouldn't re-layout
  2. I'm concerned that this is a different chunk of code than other screens. Likely the resetAllButton should be positioned in the same way on all screens since it is pretty much in the same spot.
  3. This sim isn't in active development, so I'm not trying to spend too much time here. I wrote out a TODO to this issue, so hopefully it can get tackled next time dynamic locale is tackled + phet-io for this sim.

@zepumph
Copy link
Member Author

zepumph commented Jan 9, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant