mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
uidriver: Remove force focusing by clicking the body
As long as the game is embedded in an iframe, this is no longer needed.
This commit is contained in:
parent
bd888f62b9
commit
dea716c9a6
@ -292,13 +292,6 @@ func init() {
|
|||||||
bodyStyle.Set("margin", "0")
|
bodyStyle.Set("margin", "0")
|
||||||
bodyStyle.Set("padding", "0")
|
bodyStyle.Set("padding", "0")
|
||||||
|
|
||||||
// TODO: This is OK as long as the game is in an independent iframe.
|
|
||||||
// What if the canvas is embedded in a HTML directly?
|
|
||||||
document.Get("body").Call("addEventListener", "click", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
|
||||||
canvas.Call("focus")
|
|
||||||
return nil
|
|
||||||
}))
|
|
||||||
|
|
||||||
canvasStyle := canvas.Get("style")
|
canvasStyle := canvas.Get("style")
|
||||||
canvasStyle.Set("width", "100%")
|
canvasStyle.Set("width", "100%")
|
||||||
canvasStyle.Set("height", "100%")
|
canvasStyle.Set("height", "100%")
|
||||||
|
Loading…
Reference in New Issue
Block a user