From 9bf5f2188f0379a15db062a3b87b5ec844c600e9 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 6 Jun 2022 08:25:43 +0900 Subject: [PATCH] internal/atlas: add an assertion at SetIsolated --- internal/atlas/image.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/atlas/image.go b/internal/atlas/image.go index d972b2ac8..acf990b6c 100644 --- a/internal/atlas/image.go +++ b/internal/atlas/image.go @@ -712,6 +712,9 @@ func NewImage(width, height int) *Image { } func (i *Image) SetIsolated(isolated bool) { + if i.backend != nil { + panic("atlas: SetIsolated must be called before its backend is allocated") + } i.isolated = isolated }