ts-defold / tsd-template-yagames

Yandex Games Template
https://ts-defold.dev/tsd-template-yagames/
MIT License
8 stars 1 forks source link

Canvas is no longer centred on web #42

Closed thinknathan closed 3 months ago

thinknathan commented 3 months ago

This alignment issue is new to me. Something may have changed in the last couple Defold versions.

Screenshot 2024-06-25 at 7 03 48 PM

Tested on Firefox and Chrome, same result.

thejustinwalsh commented 3 months ago

I thought I was using a css grid to pull that off? I also wonder what happened here...?

thejustinwalsh commented 3 months ago

It doesn't look like the index.html file has changed much over the last 3 years, so maybe some edge case of styling I was leaning on has been modified in web browsers, and this is the result of some implicit behavior that is no longer valid?

https://github.com/ts-defold/tsd-template-yagames/blame/4d4b7ffc4c402bb4de5ac89e60bb575c2d0acb21/index.html

thejustinwalsh commented 3 months ago

Something is now injecting inline styling on the app-container element.

image
thejustinwalsh commented 3 months ago

@thinknathan I just updated the game.project and built it locally, and I do not see this issue. Tracking down what is different from my local env.

thejustinwalsh commented 3 months ago

@thinknathan I just updated the game.project and built it locally, and I do not see this issue. Tracking down what is different from my local env.

Well... I didn't restart Defold to apply the update, and the latest binary adds the extra styles to the canvas element. 😭

thejustinwalsh commented 3 months ago

image

thejustinwalsh commented 3 months ago

I think I located the offending changes here: Most of the Scale Modes inject inline styles. https://github.com/defold/defold/pull/8682/files#diff-b82ef5179fba0dcb45eca1520e9a3f9e0372c4846534e91545ab5a84e5ae7326R987-R1041