Skip to content

Commit 8ead7ef

Browse files
authored
Merge pull request #702 from HSF/fix701
Set line material colour too.
2 parents b512fcb + 2c96966 commit 8ead7ef

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

packages/phoenix-event-display/src/managers/three-manager/color-manager.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import {
22
Color,
33
MeshPhongMaterial,
4+
LineBasicMaterial,
45
Mesh,
56
Object3D,
67
Material,
78
type Object3DEventMap,
9+
Line,
810
} from 'three';
911
import { SceneManager } from './scene-manager';
1012

@@ -133,5 +135,11 @@ function setColorForObject(object: Object3D<Object3DEventMap>, color: any) {
133135
} else if ('color' in material) {
134136
(material.color as Color).set(color);
135137
}
138+
} else if (object instanceof Line) {
139+
const line = object as Line;
140+
const material = line.material;
141+
if ('color' in material) {
142+
(material.color as Color).set(color);
143+
}
136144
}
137145
}

0 commit comments

Comments
 (0)