mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
Modify comments
This commit is contained in:
parent
5a29657201
commit
3b02993a5d
@ -163,7 +163,6 @@ func devicePixelRatio() int {
|
||||
func Start(width, height, scale int, title string) (actualScale int, err error) {
|
||||
doc := js.Global.Get("document")
|
||||
doc.Set("title", title)
|
||||
// for retina
|
||||
actualScale = scale * devicePixelRatio()
|
||||
canvas.Set("width", width*actualScale)
|
||||
canvas.Set("height", height*actualScale)
|
||||
@ -173,6 +172,7 @@ func Start(width, height, scale int, title string) (actualScale int, err error)
|
||||
cssHeight := height * scale
|
||||
canvasStyle.Set("width", strconv.Itoa(cssWidth)+"px")
|
||||
canvasStyle.Set("height", strconv.Itoa(cssHeight)+"px")
|
||||
// CSS calc requires space chars.
|
||||
canvasStyle.Set("left", "calc(50% - "+strconv.Itoa(cssWidth/2)+"px)")
|
||||
canvasStyle.Set("top", "calc(50% - "+strconv.Itoa(cssHeight/2)+"px)")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user