Hello everyone! Does anyone have a problem when th...
# compose-web
g
Hello everyone! Does anyone have a problem when the content of a canvas is drifting up and left on each reload of the page?
solved 1
Ok, it looks like the problem is that viewport hack. Well, to be honest it is the way I implemented it.
I'm using this code in the beginning of my
main()
Copy code
val meta = document.createElement("meta")
  meta.setAttribute("name", "viewport")
  meta.setAttribute("content",
      "width=" + (window.screen.width * window.devicePixelRatio) / 2 + ", initial-scale=1, maximum-scale=1, user-scalable=0")
  document.head?.appendChild(meta)

  window.addEventListener("resize", { _ ->
    meta.setAttribute("content",
        "width=" + (window.screen.width * window.devicePixelRatio) / 2 + ", initial-scale=1, maximum-scale=1, user-scalable=0")
  })
However, the
, maximum-scale=1, user-scalable=0
is doing something odd and when I removed it the drifting disappears.
c
It looks like this will be fixed in Compose 1.6.10 per: https://github.com/JetBrains/compose-multiplatform/issues/4620
❤️ 1