-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Safari] Splash screen increases in scale slightly after loading has begun #407
Comments
I recommend to fix this not because it is a jarring visual issue but because it could indicate problems with how CSS is being dealt with in Joist, and could lead to problems in future browser versions (not just safari). |
This is very subtle on my MBP, but I can see it. |
To get to the same version of the code, I used dependencies.json and grunt --lint=false. I tried commenting out several CSS parts in joist, but the problem persists. |
The problem is that the image changes size. On the first call, it is 273px wide then after load it is 274px wide. Adding this code works around the problem: var splashImageWidth = 0;
var splashImageHeight = 0;
/**
* Scale and position the given div, using the dimensions of the image for sizing.
* @param {Element} div - the div to position
* @param {HTMLImageElement} splashImg - the image to use for determining scale factor. Not as exact as using the full
* - container div, but that dimension is not available on startup.
*/
function positionDiv( div, splashImg ) {
if ( splashImageWidth === 0 && splashImageHeight === 0 ) {
splashImageWidth = splashImg.width;
splashImageHeight = splashImg.height;
}
var currentWidth = splashImageWidth;
var currentHeight = splashImageHeight; |
Still seeing the problem in latest safari and merged with master. |
I committed the workaround above and it still seems good for safari. |
@jonathanolson suggested to check the naturalwidth |
naturalWidth had the same problem as width, but @jonathanolson suggested to round out the image size by expanding the artboard then svg, and that seemed to fix the problem. Didn't fix IE though. |
Fixed in the preceding commits, on hold until we work out IE in #408 |
This is out for testing in the aforementioned issue. |
I no longer see this on macOS 10.12.6, iOS 10.3 beta, or iOS 9.3.5. |
Blink and you'll miss it (actually the looping gif makes it very obvious, but it is very subtle otherwise):
This is present on both mobile and desktop Safari. It happens every time I load the sim on macOS 10.12.3, but only happens once on the initial load for iOS 10.2 Safari. To make it happen again on mobile Safari, I can switch to and from another open tab, then reload the sim.
Tested with this link http://www.colorado.edu/physics/phet/dev/html/energy-skate-park-basics/1.3.1-dev.3/energy-skate-park-basics_en.html
The text was updated successfully, but these errors were encountered: