Bug fix: limit for the number of vertices

This commit is contained in:
Hajime Hoshi 2015-01-14 10:31:09 +09:00
parent 665ef46064
commit 6aef42d6fa

View File

@ -59,7 +59,8 @@ func DrawTexture(c *opengl.Context, texture opengl.Texture, projectionMatrix *[4
return nil return nil
} }
// TODO: Change this panic if image.DrawImage allows more than quadsMaxNum parts. // TODO: Change this panic if image.DrawImage allows more than quadsMaxNum parts.
if quadsMaxNum < quads.Len() { // TODO: Kinder message
if quadsMaxNum < 4*quads.Len() {
return errors.New(fmt.Sprintf("len(quads) must be equal to or less than %d", quadsMaxNum)) return errors.New(fmt.Sprintf("len(quads) must be equal to or less than %d", quadsMaxNum))
} }