From 657c1ea1ecd96c514ca9f67ac4bdcee74910dbcd Mon Sep 17 00:00:00 2001 From: Tim Deubler Date: Tue, 9 Jul 2024 10:22:54 +0200 Subject: [PATCH] fix potential issue in case alpha is set to 0 (should not be rendered at all) Signed-off-by: Tim Deubler --- packages/display/src/displays/webgl/buffer/FeatureFactory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/display/src/displays/webgl/buffer/FeatureFactory.ts b/packages/display/src/displays/webgl/buffer/FeatureFactory.ts index aebb4225a..bf0b87d43 100644 --- a/packages/display/src/displays/webgl/buffer/FeatureFactory.ts +++ b/packages/display/src/displays/webgl/buffer/FeatureFactory.ts @@ -170,7 +170,7 @@ export class FeatureFactory { private toRGBA(color: Color, alpha: number = 1, premultiplyAlpha: boolean = true): RGBA { const rgba = Array.isArray(color) - ? [color[0], color[1], color[2], color[3]??1] as RGBA + ? [color[0], color[1], color[2], typeof color[3] == 'number' ? color[3] : 1] as RGBA : toRGB(color); if (rgba) { alpha = rgba[3] *= alpha;