From f1d97a7758029bb4a2f154b34ce6b9ce5408b745 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 5 Mar 2018 10:53:42 +0900 Subject: [PATCH] graphics: Refactoring --- graphicscontext.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/graphicscontext.go b/graphicscontext.go index b71dc305e..2671ed893 100644 --- a/graphicscontext.go +++ b/graphicscontext.go @@ -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 }