internal/restorable: early return for an empty rectangle

This commit is contained in:
Hajime Hoshi 2023-05-25 19:17:22 +09:00
parent 90562ee84b
commit 47f19da710

View File

@ -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()