Closed marlitas closed 6 months ago
Okay this issue is ready for review. Sending over to @Luisav1 or @AgustinVallejo. Whoever wants to get to it first.
One remaining TODO, that I need to check in with @pixelzoom about.
Hi! Reviewed the commits and they look good to me. Only two questions @marlitas
On the following commit, how come the margin changed so drastically? https://github.com/phetsims/arithmetic/commit/a9a4d23829da52e37e5af6809ff33fd07e9d819a
- yMargin: 38
+ bottomMargin: 180
I've never seen this used, what is its purpose? Out of curiosity: https://github.com/phetsims/arithmetic/commit/9c3d6662e37a5987713c0dd9c6671c1299e15546
+ ManualConstraint.create
Thanks for the review @AgustinVallejo!
how come the margin changed so drastically?
I switched the AlignBox to align along the "bottom" of the layoutBounds since the buttons were jumping around as the font sized changed for the titles when the AlignBox was set to align along the "top". By switching to have alignBox track the bottom of its VBox contents I had to adjust the margin to go from the bottom of the layoutBounds to the bottom of the VBox content instead of measuring the space from the top of the layoutBounds to the top of the VBox content.
I've never seen this used, what is its purpose? Out of curiosity:
ManualConstraint is a way to specify a custom layout. I think of it a bit like a multilink for node bounds. Additionally ManualConstraint does some behind the scenes work to make sure the proxies that you are accessing in the callback are all in the same coordinate frame. I've been using it a lot in this dynamic layout work because it allows me to add in dynamic layout without doing major restructures to the sim's view architecture. It's probably a bit overload in a lot of the usage cases for the layout work I've been doing, but seemed better to go that route than to really tear up this older code that could potentially introduce other bugs and just isn't worth the time right now.
Let me know if there are any other questions or suggestions. Otherwise I think we can close!
Thanks for the insightful answer! Closing :)
Reopening because there is a TODO marked for this issue.
Oops connected TODO to a different issue.
THis issue will track work related to converting the sim to dynamic locale and it's usage of dynamic layout.