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

Layout jostling when moving the sliders #68

Closed
zepumph opened this issue Jul 20, 2017 · 12 comments
Closed

Layout jostling when moving the sliders #68

zepumph opened this issue Jul 20, 2017 · 12 comments

Comments

@zepumph
Copy link
Member

zepumph commented Jul 20, 2017

@jessegreenberg helped me find a strange bug where the whole sim, especially the control panel and it's contents will resize as you move the sliders. It's hard to pin down exactly what conditions are making this happen. @jessegreenberg has found that with chrome this is happening for http://www.colorado.edu/physics/phet/dev/html/ohms-law/1.4.0-phetiodev.2/ohms-law_en-phetio.html?phetioStandalone but not from master, where I was noticing that exact opposite. We were also seeing no change between incognito/normal versions of chrome or firefox. On firefox it happens, but to a lesser degree.

@zepumph zepumph self-assigned this Jul 20, 2017
@zepumph
Copy link
Member Author

zepumph commented Jul 20, 2017

This is for phetsims/qa#24, kinda sorta.

@zepumph
Copy link
Member Author

zepumph commented Jul 20, 2017

@phet-steele can you comment on the cross product of tests of master/ the above dev link vs firefox chrome for you.

@zepumph
Copy link
Member Author

zepumph commented Jul 20, 2017

I went back through the last 10 or so commits in ohms-law, checking them out and restarting the sim from master, and every time it sill persisted. I'm having a hard time linking this to a specific patch of code.

@zepumph
Copy link
Member Author

zepumph commented Jul 20, 2017

@phet-steele and I talked and tested. We say that all the local bounds we were checking were not changing. We think that it may have to do with kerning, like phetsims/scenery#193. @jonathanolson can you comment?

EDIT: sorry I accidentally commented before I was done typing.

@zepumph
Copy link
Member Author

zepumph commented Jul 21, 2017

I'm seeing this in RIAW as well.

EDIT: I will tackle this in the context of RIAW first, because there is less code (layout focused) that has been touched.

@zepumph
Copy link
Member Author

zepumph commented Aug 1, 2017

In RIAW:
I may have figured out why this is happening, although I haven't yet found a solution.

When I link to the resistance property and print out the centerX/Y of components. I notice that the centerX of FomulaNode and WireNode are changing. Even as they scale I wouldn't want that to change (I think).

The WireNode ranges from centerX from 317.42693939886584 to 317.4396337358218. Not a ton, but perhaps enough to make a problem. WireNode's centerX is originally set by FormulaNode though, which ranges from 318.6086595993758 to 133.2824795948227. FomulaNode I understand, and I'm not sure it is an error. This is because the R is scaling way beyond the screen, and centerX is being recalculated every frame.

I'm not sure what to do with this info. It seems like most of the jostling is happening in the ControlPanel, but the centerX/bounds of it aren't changing at all.

@zepumph
Copy link
Member Author

zepumph commented Aug 1, 2017

It seems like the behavior that I see changes by the day, so I will start keeping track of it. I will report the presence of this behavior based on build/local and browser. 'yes' means that the jostling was there.

Built version >= 1.3.0-dev.3 Requirejs 1.3.0-dev.2
Chrome no yes no
Chrome Ingonito no yes no
Firefox yes yes no (EDIT: there is "minimal" jostling here like in 1.3.0-dev.2-new)
Opera no yes no

EDIT: all these built versions tested were from spot.

@zepumph
Copy link
Member Author

zepumph commented Aug 1, 2017

1.3.0-dev.3 was the first dev release I had done since redoing the layout. I'm sure I'm doing some practice that isn't good. Here is a list of the commits that I made before that version's release, Mon Jul 17 2017 19:33:07 GMT-0800 (Alaskan Daylight Time).

commit 1b439c70f6f513f1849d795a4de124aa3c3acfcb
Author: zepumph <michael.kauzmann@colorado.edu>
Date:   Mon Jul 17 18:55:06 2017 -0800

    lint fix, https://github.com/phetsims/resistance-in-a-wire/issues/91

commit 1059b1b569fef2782da6adaa86dfb96a2b29d5fd
Author: zepumph <michael.kauzmann@colorado.edu>
Date:   Mon Jul 17 18:53:54 2017 -0800

    fix i18n with FormulaNode, https://github.com/phetsims/resistance-in-a-wire/issues/91

commit bade897d99820cf310bd982fb7a3e9e621d66b07
Author: zepumph <michael.kauzmann@colorado.edu>
Date:   Mon Jul 17 18:37:41 2017 -0800

    format panel for i18n, https://github.com/phetsims/resistance-in-a-wire/issues/91

These are the only commits after 1.3.0-dev.2 as well. Unless this problem is in common code (doubtful) I think one of these commits above caused it.

@zepumph
Copy link
Member Author

zepumph commented Aug 1, 2017

Next I checked out the commit before these above (19139eb91993ed3b03ebaa3d88852549e4272937 update version to 1.3.0-dev.2, and it looks like the problem is still present!


RIAW sha same as 1.3.0-dev.2 on spot but everything else on master

local build requirejs mode
chrome yes yes
firefox yes yes

This makes me wonder if it doesn't have to do with some common code changes, so I checked out all dependencies for 1.3.0-dev.2 that is on spot (same as the dependencies when checking out the above commit) and I tested that in requirejs, local build, and built/deploy to spot (1.3.0-dev.2-new) on different browsers.




Same shas as 1.3.0-dev.2 (deployed with "-new")

requirejsMode local build on spot (1.3.0-dev.2-new)
chrome yes yes no
chrome incognito yes yes no
firefox yes yes yes (but much more minimally)
opera no no no

I may have to go back even further than I thought. But it also may have something to do with a browser change (not likely), or something else that I'm not thinking about

@zepumph
Copy link
Member Author

zepumph commented Aug 14, 2017

I just looked at master for OL and RIAW today, and I noticed that this problem isn't nearly as present as it used to be. From master on both sims. Firefox is the only browser that shows this error at all, and it is very very minimal only when making the resistance largest value that you can. @phet-steele could you tell me if you are experiencing the same thing. I'm trying to narrow down the variance, it may have to do with my computer somewhat. Do you notice this problem on master? Please look at chrome/firefox and OL and RIAW.

@jessegreenberg
Copy link
Contributor

@zepumph I am still seeing this happening in master in chrome. Have we tried preventFit option of Node?

@zepumph
Copy link
Member Author

zepumph commented Sep 28, 2017

@jessegreenberg I really appreciate you!!! That was it. I couldn't figure out exactly how this was happening. Thanks for stepping in. We are ready to move RIAW and OL forward to releases. We should make sure to link this issue in RC tests to make sure QA confirms that it is fixed. Closing!

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

4 participants