Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/core/renderers/canvas/CanvasCoreRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ export class CanvasCoreRenderer extends CoreRenderer {
const textureType = texture?.type;
assertTruthy(textureType, 'Texture type is not defined');

// The Canvas2D renderer only supports image and color textures
// The Canvas2D renderer only supports image and color textures and subTexture images
if (
textureType !== TextureType.image &&
textureType !== TextureType.color
textureType !== TextureType.color &&
textureType !== TextureType.subTexture
) {
return;
}
Expand Down Expand Up @@ -185,7 +186,11 @@ export class CanvasCoreRenderer extends CoreRenderer {
ctx.clip(path);
}

if (textureType === TextureType.image && ctxTexture) {
if (
(textureType === TextureType.image ||
textureType === TextureType.subTexture) &&
ctxTexture
) {
const image = ctxTexture.getImage(color);
ctx.globalAlpha = color.a ?? alpha;
if (frame) {
Expand Down
Loading