Cross-platform 2D framework written in Haxe that can export natively to desktop (windows, mac, linux), mobile (ios, android), web (js + webgl) and to unity projects
MIT License
263
stars
22
forks
source link
clay/runtime/src/Main.hx 314 gets stuck in checkSizeReady in web browsers. #84
The function checkSizeReady never sets readyToDisplay = true; since appEl.offsetWidth == containerEl.offsetWidth never becomes true when you run your program in a "normal" web browsers.
I tried to change the checkSizeReady function to appEl.offsetWidth <= containerEl.offsetWidth but then you get a layout flicker at the start of your program. (Actually it still gets stuck in a loop on Chrome on my Android phone)
But if I let the program run, the sizes will become the same. When I console.log the variables by hand when the program finished loading the result is this:
Hi!
The function checkSizeReady never sets
readyToDisplay = true;
sinceappEl.offsetWidth == containerEl.offsetWidth
never becomes true when you run your program in a "normal" web browsers.https://github.com/ceramic-engine/ceramic/blob/4b655f5c902359758b6d410b113436c764c864de/plugins/clay/runtime/src/Main.hx#L314
I tried to change the
checkSizeReady
function toappEl.offsetWidth <= containerEl.offsetWidth
but then you get a layout flicker at the start of your program. (Actually it still gets stuck in a loop on Chrome on my Android phone)You can see an example of this happening here: https://www.qeshi.com/mori/14/web/
I'm logging the sizes of the elements in this version:
In the beginning of the program the sizes differ.
But if I let the program run, the sizes will become the same. When I
console.log
the variables by hand when the program finished loading the result is this:I thought it maybe it had something with in what order the
ceramic.App
loaders are in. Here: https://github.com/ceramic-engine/ceramic/blob/4b655f5c902359758b6d410b113436c764c864de/runtime/src/ceramic/App.hx#L972But I not sure anymore because when I trace them there is not that many loaders.