diff --git a/imageimpl.go b/imageimpl.go index ac4dca5f3..9bea77ba1 100644 --- a/imageimpl.go +++ b/imageimpl.go @@ -174,21 +174,21 @@ func (i *imageImpl) DrawImage(image *Image, options *DrawImageOptions) error { if i.disposed { return errors.New("ebiten: image is already disposed") } + geom := options.GeoM + colorm := options.ColorM c := &drawImageHistoryItem{ image: image.impl.image, vertices: vertices, - geom: options.GeoM, - colorm: options.ColorM, + geom: &geom, + colorm: &colorm, mode: opengl.CompositeMode(options.CompositeMode), } if image.impl.pixels.inconsistent { i.pixels.makeInconsistent() } i.pixels.appendDrawImageHistory(c) - geom := &options.GeoM - colorm := &options.ColorM mode := opengl.CompositeMode(options.CompositeMode) - if err := i.image.DrawImage(image.impl.image, vertices, geom, colorm, mode); err != nil { + if err := i.image.DrawImage(image.impl.image, vertices, &geom, &colorm, mode); err != nil { return err } return nil diff --git a/pixels.go b/pixels.go index 3582cb213..3c515aaaf 100644 --- a/pixels.go +++ b/pixels.go @@ -25,8 +25,8 @@ import ( type drawImageHistoryItem struct { image *graphics.Image vertices []int16 - geom GeoM - colorm ColorM + geom graphics.Matrix + colorm graphics.Matrix mode opengl.CompositeMode } @@ -181,7 +181,7 @@ func (p *pixels) restore(context *opengl.Context, width, height int, filter Filt /*if c.image.impl.hasHistory() { panic("not reach") }*/ - if err := gimg.DrawImage(c.image, c.vertices, &c.geom, &c.colorm, c.mode); err != nil { + if err := gimg.DrawImage(c.image, c.vertices, c.geom, c.colorm, c.mode); err != nil { return nil, err } }