graphics: Refactoring

This commit is contained in:
Hajime Hoshi 2018-03-05 10:53:42 +09:00
parent dcb05fb9ad
commit f1d97a7758

View File

@ -54,15 +54,13 @@ func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale flo
if c.offscreen != nil {
_ = c.offscreen.Dispose()
}
offscreen := newVolatileImage(screenWidth, screenHeight, FilterDefault)
c.offscreen = newVolatileImage(screenWidth, screenHeight, FilterDefault)
w := int(float64(screenWidth) * screenScale)
h := int(float64(screenHeight) * screenScale)
px0, py0, _, _ := ui.ScreenPadding()
c.screen = newImageWithScreenFramebuffer(w, h)
c.offscreen = offscreen
c.offsetX = px0
c.offsetY = py0
}