devicescale: Use devicePixelRatio property for go2cpp

This commit is contained in:
Hajime Hoshi 2020-12-20 00:45:13 +09:00
parent 903cc37ab4
commit 2106e0fa6a

View File

@ -19,6 +19,10 @@ import (
)
func impl(x, y int) float64 {
if go2cpp := js.Global().Get("go2cpp"); go2cpp.Truthy() {
return go2cpp.Get("devicePixelRatio").Float()
}
window := js.Global().Get("window")
if !window.Truthy() {
return 1