graphicsdriver/monogame: Bug fix: An underlying image size should be adjusted

This commit is contained in:
Hajime Hoshi 2020-04-21 02:43:47 +09:00
parent 29ef737413
commit 691e42f806

View File

@ -19,6 +19,7 @@ package monogame
import ( import (
"github.com/hajimehoshi/ebiten/internal/affine" "github.com/hajimehoshi/ebiten/internal/affine"
"github.com/hajimehoshi/ebiten/internal/driver" "github.com/hajimehoshi/ebiten/internal/driver"
"github.com/hajimehoshi/ebiten/internal/graphics"
"github.com/hajimehoshi/ebiten/internal/monogame" "github.com/hajimehoshi/ebiten/internal/monogame"
"github.com/hajimehoshi/ebiten/internal/thread" "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) { 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{ return &Image{
v: v, v: v,
g: g, g: g,