internal/restorable: skip basePixels.Clear when the region is empty

This commit is contained in:
Hajime Hoshi 2023-03-08 16:21:45 +09:00
parent e4fffaf963
commit 7f182e7814

View File

@ -248,6 +248,9 @@ func (i *Image) makeStale(rect image.Rectangle) {
// Clear pixels to save memory.
for _, r := range i.staleRegions[origNum:] {
if r.Empty() {
continue
}
i.basePixels.Clear(r.Min.X, r.Min.Y, r.Dx(), r.Dy())
}