-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fullscreen, resizable canvas – not visible on page load #10
Comments
Very strange! This would be a great feature to add to the Fullscreen.elm example once we figure it out. I’m in the move and checked the Ellie on the phone, and what I see is multiple resize events being triggered with the size increasing each time. I see the canvas flicker black and red to white to finally nothing. Do you see multiple resize events too? If you do it may be that changing the canvas dimensions is re-triggering a resize event for some reason. |
I have a game example that does full screen and resizes and doesn’t seem to have a problem: https://github.com/joakin/elm-basic-platformer-game/blob/master/src/Main.elm The setup seems very similar, so I’m not sure what may be going wrong. |
In the Ellie debugger, I only see singular updates to the Model when resizing screen by a single pixel. However, you're correct that it does seem like the canvas gets drawn every time and then erased, as it flashes on screen before going white. I have a pretty busy day, but if I can find the time I'll try making a copy of your game and pairing it back to just a blank canvas to see if I can spot the problem. |
Also, I feel like maybe the animation in the game example, much like firing off keypresses in mine, is somehow masking the issue. |
I'm trying to draw a canvas that spans the entire width and height of the window and resizes dynamically when the window size changes. However, the canvas isn't getting painted on the initial page load, but only on subsequent updates. I've tried multiple implementations but the same problem keeps recurring.
Here's an Ellie showing the issue. Notice how the screen is blank until after a keypress event fires the update, and then the canvas appears.
As a work-around, I can change the
screen
record into aMaybe
, however that just shifts the problem from occurring on initial screen load to on resize.And just for the sake of good record-keeping here's the code from the Ellie linked above:
The text was updated successfully, but these errors were encountered: