From 2c96966d90d1e24b87c5efd23955189e9c024e38 Mon Sep 17 00:00:00 2001 From: Edward Moyse Date: Sat, 30 Nov 2024 10:11:59 +0100 Subject: [PATCH] Set line material colour too. --- .../src/managers/three-manager/color-manager.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/phoenix-event-display/src/managers/three-manager/color-manager.ts b/packages/phoenix-event-display/src/managers/three-manager/color-manager.ts index 1c539546..a7866797 100644 --- a/packages/phoenix-event-display/src/managers/three-manager/color-manager.ts +++ b/packages/phoenix-event-display/src/managers/three-manager/color-manager.ts @@ -1,10 +1,12 @@ import { Color, MeshPhongMaterial, + LineBasicMaterial, Mesh, Object3D, Material, type Object3DEventMap, + Line, } from 'three'; import { SceneManager } from './scene-manager'; @@ -133,5 +135,11 @@ function setColorForObject(object: Object3D, color: any) { } else if ('color' in material) { (material.color as Color).set(color); } + } else if (object instanceof Line) { + const line = object as Line; + const material = line.material; + if ('color' in material) { + (material.color as Color).set(color); + } } }