From 7f1074451416414b84741c107779cada60d5f7ef Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 6 Jun 2022 09:01:04 +0900 Subject: [PATCH] internal/atlas: add an assertion at putOnAtlas --- internal/atlas/image.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/atlas/image.go b/internal/atlas/image.go index acf990b6c..cd5600726 100644 --- a/internal/atlas/image.go +++ b/internal/atlas/image.go @@ -323,9 +323,11 @@ func (i *Image) putOnAtlas(graphicsDriver graphicsdriver.Graphics) error { if !i.canBePutOnAtlas() { panic("atlas: putOnAtlas cannot be called on a image that cannot be on an atlas") } + if i.volatile { + panic("atlas: a volatile image cannot be put on an atlas") + } newI := NewImage(i.width, i.height) - newI.SetVolatile(i.volatile) if restorable.NeedsRestoring() { // If the underlying graphics driver requires restoring from the context lost, the pixel data is