From e74c96f35b6d77f0ad2dc1717c50a30f44ef1e58 Mon Sep 17 00:00:00 2001 From: marius david Date: Sat, 13 Jul 2024 12:44:11 +0200 Subject: [PATCH] Fix display of the canvas color when template is used --- packages/client/src/lib/template.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/client/src/lib/template.ts b/packages/client/src/lib/template.ts index 4770fdd..75262f0 100644 --- a/packages/client/src/lib/template.ts +++ b/packages/client/src/lib/template.ts @@ -510,7 +510,11 @@ export class Template extends EventEmitter { vec2 styleCoord = (indexCoord + subTexCoord) * styleSize; vec4 styleMask = vec4(1.0, 1.0, 1.0, texture2D(u_Style, styleCoord).a); - gl_FragColor = vec4(templateSample.rgb, templateSample.a == PALETTE_TRANSPARENT ? 0.0 : 1.0) * styleMask; + if (texture2D(u_Style, styleCoord).a == 1.0) { + gl_FragColor = vec4(templateSample.rgb, templateSample.a == PALETTE_TRANSPARENT ? 0.0 : 1.0) * styleMask; + } else { + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); + } } ` ); -- GitLab