mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-23 17:32:02 +01:00
internal/restorable: skip basePixels.Clear when the region is empty
This commit is contained in:
parent
e4fffaf963
commit
7f182e7814
@ -248,6 +248,9 @@ func (i *Image) makeStale(rect image.Rectangle) {
|
|||||||
|
|
||||||
// Clear pixels to save memory.
|
// Clear pixels to save memory.
|
||||||
for _, r := range i.staleRegions[origNum:] {
|
for _, r := range i.staleRegions[origNum:] {
|
||||||
|
if r.Empty() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
i.basePixels.Clear(r.Min.X, r.Min.Y, r.Dx(), r.Dy())
|
i.basePixels.Clear(r.Min.X, r.Min.Y, r.Dx(), r.Dy())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user