mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 03:02:49 +01:00
ui: Bug fix: initial scale must be 1 for proper scaling
This commit is contained in:
parent
565a28ff04
commit
d6466fdcaf
@ -167,6 +167,13 @@ func initialize() error {
|
|||||||
currentUI.windowFocus = false
|
currentUI.windowFocus = false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Adjust the initial scale to 1.
|
||||||
|
// https://developer.mozilla.org/en/docs/Mozilla/Mobile/Viewport_meta_tag
|
||||||
|
meta := doc.Call("createElement", "meta")
|
||||||
|
meta.Set("name", "viewport")
|
||||||
|
meta.Set("content", "width=device-width, initial-scale=1")
|
||||||
|
doc.Get("body").Call("appendChild", meta)
|
||||||
|
|
||||||
canvas = doc.Call("createElement", "canvas")
|
canvas = doc.Call("createElement", "canvas")
|
||||||
canvas.Set("width", 16)
|
canvas.Set("width", 16)
|
||||||
canvas.Set("height", 16)
|
canvas.Set("height", 16)
|
||||||
|
Loading…
Reference in New Issue
Block a user