Skip to content

Commit 1a11f07

Browse files
committed
fix setSurfacesColor
1 parent 93cd170 commit 1a11f07

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/scene.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { get_required } from "./utility.ts";
66
import { AbstractSceneElement } from "./elements/AbstractSceneElement.ts";
77
import { ArrowsElement } from "./elements/ArrowsElement.ts";
88
import { PointsElement } from "./elements/PointsElement.ts";
9+
import { SurfaceBaseElement } from "./elements/SurfaceBaseElement.ts";
910
import { SurfaceLatheElement } from "./elements/SurfaceLatheElement.ts";
1011
import { SurfacePlaneElement } from "./elements/SurfacePlaneElement.ts";
1112
import { WIPXYElement } from "./elements/WIPXYElement.ts";
@@ -124,7 +125,7 @@ export class TLMScene {
124125
// Call a function on all elements of the scene graph matching a given
125126
// subtype of AbstractSceneElement
126127
public updateElements<T extends AbstractSceneElement>(
127-
type: new (...args: any[]) => T,
128+
type: Function & { prototype: T },
128129
f: (group: THREE.Group, element: T) => void
129130
): void {
130131
this.sceneGraph.traverse((child: THREE.Object3D) => {
@@ -179,8 +180,8 @@ export class TLMScene {
179180

180181
public setSurfacesColor(color: THREE.Color): void {
181182
this.updateElements(
182-
SurfaceLatheElement,
183-
(group: THREE.Group, element: SurfaceLatheElement) => {
183+
SurfaceBaseElement,
184+
(group: THREE.Group, element: SurfaceBaseElement) => {
184185
element.setColor(group, color);
185186
}
186187
);

0 commit comments

Comments
 (0)