Reland: graphics: Use math.Ceil for the screen framebuffer size (#622)

This is reland of 0b60471ac0.

I thought this didn't take any effect, but I confirmed this
actually fixed (part of) the blinking-line problem on Xperia XZ.
This fixes the upper side thin line. I'm not sure this fixes the
lower side thin line, which is reported but I couldn't reproduce.

I expect this and e829e650f2 will
fix the reported problem, and I am going to confirm this.
This commit is contained in:
Hajime Hoshi 2019-01-16 23:41:49 +09:00
parent b5ee209e0b
commit 18daa04173

View File

@ -64,8 +64,8 @@ func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale flo
}
c.offscreen = newVolatileImage(screenWidth, screenHeight)
w := int(float64(screenWidth) * screenScale)
h := int(float64(screenHeight) * screenScale)
w := int(math.Ceil(float64(screenWidth) * screenScale))
h := int(math.Ceil(float64(screenHeight) * screenScale))
px0, py0, px1, py1 := ui.ScreenPadding()
c.screen = newImageWithScreenFramebuffer(w+int(math.Ceil(px0+px1)), h+int(math.Ceil(py0+py1)))
c.screenWidth = w