mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
internal/restorable: early return for an empty rectangle
This commit is contained in:
parent
90562ee84b
commit
47f19da710
@ -28,6 +28,9 @@ type pixelsRecord struct {
|
||||
|
||||
func (p *pixelsRecord) clearIfOverlapped(rect image.Rectangle) {
|
||||
r := p.rect.Intersect(rect)
|
||||
if r.Empty() {
|
||||
return
|
||||
}
|
||||
ox := r.Min.X - p.rect.Min.X
|
||||
oy := r.Min.Y - p.rect.Min.Y
|
||||
w := p.rect.Dx()
|
||||
|
Loading…
Reference in New Issue
Block a user