diff --git a/examples/clay-official-website/index.html b/examples/clay-official-website/index.html index d9271a8..497f52a 100644 --- a/examples/clay-official-website/index.html +++ b/examples/clay-official-website/index.html @@ -426,7 +426,8 @@ element.style.height = Math.round(renderCommand.boundingBox.height.value) + 'px'; } - switch(renderCommand.commandType.value) { + // note: commandType is packed to uint8_t and has 3 garbage bytes of padding + switch(renderCommand.commandType.value & 0xff) { case (CLAY_RENDER_COMMAND_TYPE_NONE): { break; } @@ -580,7 +581,9 @@ for (let i = 0; i < length; i++, arrayOffset += renderCommandSize) { let renderCommand = readStructAtAddress(arrayOffset, renderCommandDefinition); let boundingBox = renderCommand.boundingBox; - switch(renderCommand.commandType.value) { + + // note: commandType is packed to uint8_t and has 3 garbage bytes of padding + switch(renderCommand.commandType.value & 0xff) { case (CLAY_RENDER_COMMAND_TYPE_NONE): { break; }