Skip to content

Commit 15a7f4d

Browse files
committed
check spriteColorId with typeof instead of truthy
This allows for spriteColorId === 0.
1 parent 75ab330 commit 15a7f4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Renderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ export default class Renderer {
489489
// Used for mapping drawn sprites back to their indices in a list.
490490
// By looking at the color of a given pixel, we can tell which sprite is
491491
// the topmost one drawn on that pixel.
492-
if (drawMode === ShaderManager.DrawModes.SPRITE_ID && spriteColorId) {
492+
if (drawMode === ShaderManager.DrawModes.SPRITE_ID && typeof spriteColorId === "number") {
493493
this.gl.uniform3fv(shader.uniforms.u_spriteId, idToColor(spriteColorId));
494494
}
495495

0 commit comments

Comments
 (0)