Modify comments

This commit is contained in:
Hajime Hoshi 2015-01-10 19:59:47 +09:00
parent 5a29657201
commit 3b02993a5d

View File

@ -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)")