-
Notifications
You must be signed in to change notification settings - Fork 12
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
button content offset should be handled in threeDAppearanceStrategy #236
Comments
Other buttons that are compensating for 3D by setting scenery-phet.LeftRightSpinner |
In #235, @pixelzoom compensated for the look of the reset button by adjusting the local bounds of the icon. He essentially reflected the original shape, merged the two shapes, and then used the combined bounds, which then looks reasonably centered on the flat strategy. The following image illustrates: Modifying the local bounds works, but doesn't strike me as a very general solution, and may also be a bit tricky for future developers to figure out. Here is an alternative proposal: we modify the code so that the Also, I agree with a comment that @pixelzoom made elsewhere that it would be good to rename Back to @pixelzoom for input before I make any moves on this. |
@jbphet I think you're confusing 2 unrelated issues. Creating a centerable icon and adjusting the offset for 3D appearance are two separate issues. You start with a centerable icon (as we now have for ResetButton), then compensate for centering in 3D appearance. In the case of how the ResetButton icon is now created, it's not supposed to be a general solution. It's the centering solution that's specific to the icon for this button. And it's the solution that was recommended by @jonathanolson and @samreid as being most efficient. Depending on the button, each button may have to employ some technique to make the icon centerable - but there will be no general solution to this. |
Summary of Skype voice discussion with @jbphet: In both flat and 3D appearance strategy, the content is centered on the button, subject to some offsets. In the case of flat appearance strategy, the content offsets are applied without modification. In the case of 3D appearance strategy, an additional "offset correction" will be applied that is a function of the button gradient. Hopefully this 3D offset correction will prove to be applicable to all cases, and can remain internal. If not, then @jbphet recommends adding additional options to adjust the 3D correction offset. In the general case, a button designer should ensure that their button looks good with flat appearance strategy, by either (a) providing a content Node that can be centered without adjusting Option (a) is appropriate when the content Node can be created programmatically. And the ResetButton is such a case. It's trivial to programmatically adjust localBounds such that the icon's center is the center of the circle. To do this using Options (b) is appropriate when it's not possible to programmatically create a center-able icon. StepButton may be such a button. In these cases, the best solution is to set |
I'm smacking up against this issue again in phetsims/scenery-phet#243, where the only reason for having separate "forward" and "back" step buttons is because their |
This is an issue once again in plinko-probability, see phetsims/plinko-probability#26 (comment). If we're going to use 'flat' as a means of addressing performance issues, then we need to allocate some time to address this issue. |
Discussed via Skype with @jbphet. He asked me to label this for developer meeting, specifically to discuss prioritization. |
9/1/16 dev meeting: |
There was a stray TODO in the code, but based on the prior comment, I decided to convert it to a NOTE. |
This issue was factored out of #234 and #235.
Instead of setting
xContentOffset
andyContentOffset
in (for example) ResetButton to compensate for the gradient in threeDAppearanceStrategy, that compensation should be handled (with some default values) in threeDAppearanceStrategy. It's not immediately clear to me how to do this.@jbphet Since I took care of making ResetButton look good for flatAppearanceStrategy, how about if you handle this issue?
The text was updated successfully, but these errors were encountered: