internal/restorable: use clearImage to avoid allocations

This commit is contained in:
Hajime Hoshi 2023-10-08 23:59:31 +09:00
parent e768e8ad40
commit cc8cf688f4

View File

@ -130,7 +130,7 @@ func (pr *pixelsRecords) apply(img *graphicscommand.Image) {
if r.pix != nil {
img.WritePixels(r.pix, r.rect)
} else {
img.WritePixels(make([]byte, 4*r.rect.Dx()*r.rect.Dy()), r.rect)
clearImage(img, r.rect)
}
}
}