diff --git a/sprite.go b/sprite.go index 509454e..b5420ff 100644 --- a/sprite.go +++ b/sprite.go @@ -124,12 +124,6 @@ func (spr *Sprite) Draw(screen *ebiten.Image, index int, opts *DrawOptions) { op.ColorM = opts.ColorM op.CompositeMode = opts.CompositeMode - if r != 0 { - op.GeoM.Translate(-w*ox, -h*oy) - op.GeoM.Rotate(r) - op.GeoM.Translate(w*ox, h*oy) - } - if spr.flippedH { sx = sx * -1 } @@ -143,6 +137,12 @@ func (spr *Sprite) Draw(screen *ebiten.Image, index int, opts *DrawOptions) { op.GeoM.Translate(w*ox, h*oy) } + if r != 0 { + op.GeoM.Translate(-w*ox, -h*oy) + op.GeoM.Rotate(r) + op.GeoM.Translate(w*ox, h*oy) + } + op.GeoM.Translate((x - w*ox), (y - h*oy)) subImage := spr.subImages[index]