From d6466fdcafbec97336b1eed1d5a5fb4a4d12a62c Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 2 Jul 2017 04:08:25 +0900 Subject: [PATCH] ui: Bug fix: initial scale must be 1 for proper scaling --- internal/ui/ui_js.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/ui/ui_js.go b/internal/ui/ui_js.go index f16b5e50d..1fb893bf6 100644 --- a/internal/ui/ui_js.go +++ b/internal/ui/ui_js.go @@ -167,6 +167,13 @@ func initialize() error { 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.Set("width", 16) canvas.Set("height", 16)