Merge branch 'fix_background_color_with_template' into 'main'

Fix display of the canvas color when template is used

See merge request sc07/canvas!11
This commit is contained in:
Grant 2024-07-13 14:33:25 +00:00
commit b755e87868
1 changed files with 5 additions and 1 deletions

View File

@ -510,7 +510,11 @@ export class Template extends EventEmitter<TemplateEvents> {
vec2 styleCoord = (indexCoord + subTexCoord) * styleSize; vec2 styleCoord = (indexCoord + subTexCoord) * styleSize;
vec4 styleMask = vec4(1.0, 1.0, 1.0, texture2D(u_Style, styleCoord).a); vec4 styleMask = vec4(1.0, 1.0, 1.0, texture2D(u_Style, styleCoord).a);
if (texture2D(u_Style, styleCoord).a == 1.0) {
gl_FragColor = vec4(templateSample.rgb, templateSample.a == PALETTE_TRANSPARENT ? 0.0 : 1.0) * styleMask; 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);
}
} }
` `
); );