Cache thumb bounds

This commit is contained in:
Trevor Slocum 2024-11-21 11:03:32 -08:00
parent 6da5875341
commit 707df2e07d

View file

@ -104,6 +104,7 @@ func (s *Sprite) Draw(screen *ebiten.Image) error {
s.thumb = ebiten.NewImage(s.rect.Dx(), s.rect.Dy())
}
s.thumb.DrawImage(s.img, thumbOp)
s.thumbBounds = s.thumb.Bounds()
}
screen.DrawImage(s.thumb, op)
return nil