From 86b4e9ffeb0b8e1ea3fdb8ac412704e8a9554885 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 29 Sep 2019 02:57:11 +0900 Subject: [PATCH] restorable: Bug fix: Do not mutate graphics.QuadIndices --- internal/restorable/images_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/restorable/images_test.go b/internal/restorable/images_test.go index 210e20d90..e9d09a059 100644 --- a/internal/restorable/images_test.go +++ b/internal/restorable/images_test.go @@ -803,7 +803,8 @@ func TestMutateSlices(t *testing.T) { src.ReplacePixels(pix, 0, 0, w, h) vs := quadVertices(w, h, 0, 0) - is := graphics.QuadIndices() + is := make([]uint16, len(graphics.QuadIndices())) + copy(is, graphics.QuadIndices()) dst.DrawTriangles(src, vs, is, nil, driver.CompositeModeSourceOver, driver.FilterNearest, driver.AddressClampToZero) for i := range vs { vs[i] = 0