restorable: Bug fix: Do not mutate graphics.QuadIndices

This commit is contained in:
Hajime Hoshi 2019-09-29 02:57:11 +09:00
parent 6c8c064a58
commit 86b4e9ffeb

View File

@ -803,7 +803,8 @@ func TestMutateSlices(t *testing.T) {
src.ReplacePixels(pix, 0, 0, w, h) src.ReplacePixels(pix, 0, 0, w, h)
vs := quadVertices(w, h, 0, 0) 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) dst.DrawTriangles(src, vs, is, nil, driver.CompositeModeSourceOver, driver.FilterNearest, driver.AddressClampToZero)
for i := range vs { for i := range vs {
vs[i] = 0 vs[i] = 0