restorable: Bug fix: Skip clearImage on emptyImage when restoring

This commit is contained in:
Hajime Hoshi 2019-08-15 21:53:43 +09:00
parent 01297fe015
commit 9467a67136

View File

@ -500,7 +500,11 @@ func (i *Image) restore() {
gimg := graphicscommand.NewImage(w, h)
// Clear the image explicitly.
clearImage(gimg)
if i != emptyImage {
// As clearImage uses emptyImage, clearImage cannot be called on emptyImage.
// It is OK to skip this since emptyImage has its entire pixel information.
clearImage(gimg)
}
i.basePixels.Apply(gimg)
for _, c := range i.drawTrianglesHistory {