From 691e42f806ecadfdaf9fb1e39098040c9eb2c7c9 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 21 Apr 2020 02:43:47 +0900 Subject: [PATCH] graphicsdriver/monogame: Bug fix: An underlying image size should be adjusted --- internal/graphicsdriver/monogame/graphics.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/graphicsdriver/monogame/graphics.go b/internal/graphicsdriver/monogame/graphics.go index 9c74cce1c..035246448 100644 --- a/internal/graphicsdriver/monogame/graphics.go +++ b/internal/graphicsdriver/monogame/graphics.go @@ -19,6 +19,7 @@ package monogame import ( "github.com/hajimehoshi/ebiten/internal/affine" "github.com/hajimehoshi/ebiten/internal/driver" + "github.com/hajimehoshi/ebiten/internal/graphics" "github.com/hajimehoshi/ebiten/internal/monogame" "github.com/hajimehoshi/ebiten/internal/thread" ) @@ -58,7 +59,8 @@ func (g *Graphics) SetVertices(vertices []float32, indices []uint16) { } func (g *Graphics) NewImage(width, height int) (driver.Image, error) { - v := g.game.NewRenderTarget2D(width, height) + w, h := graphics.InternalImageSize(width), graphics.InternalImageSize(height) + v := g.game.NewRenderTarget2D(w, h) return &Image{ v: v, g: g,