Skip to content

Commit 8baa2a0

Browse files
committed
Fix init order
1 parent 2ae90f2 commit 8baa2a0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/webgl-preview.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export class WebGLPreview {
156156
private devMode?: boolean | DevModeOptions = false;
157157
private _lastRenderTime = 0;
158158
private _wireframe = false;
159-
private stats?: Stats = this.devMode ? new Stats() : undefined;
159+
private stats?: Stats;
160160
private statsContainer?: HTMLElement;
161161
private devGui?: DevGUI;
162162

@@ -182,6 +182,7 @@ export class WebGLPreview {
182182
this.renderTubes = opts.renderTubes ?? this.renderTubes;
183183
this.extrusionWidth = opts.extrusionWidth ?? this.extrusionWidth;
184184
this.devMode = opts.devMode ?? this.devMode;
185+
this.stats = this.devMode ? new Stats() : undefined;
185186

186187
if (opts.extrusionColor !== undefined) {
187188
this.extrusionColor = opts.extrusionColor;

0 commit comments

Comments
 (0)