www/gcode_viewer_card.js

This commit is contained in:
Home Assistant Version Control
2026-08-10 05:33:46 +00:00
parent 014dfd9086
commit f423db5dcd
+3 -5
View File
@@ -55,9 +55,7 @@ class GcodeViewerCard extends HTMLElement {
connectedCallback() {
this._attached = true;
if (this._threeReady) {
this._ensureBuilt();
}
this._ensureBuilt();
}
disconnectedCallback() {
@@ -486,8 +484,8 @@ class GcodeViewerCard extends HTMLElement {
if (this._extSegs) { this._scene.remove(this._extSegs); this._extSegs.geometry.dispose(); }
if (this._travelSegs) { this._scene.remove(this._travelSegs); this._travelSegs.geometry.dispose(); }
const extColor = cssVar("--gcode-extrusion-color", EXT_COLOR.replace("var(--gcode-extrusion-color, ", "").replace(")", ""));
const travColor = cssVar("--gcode-travel-color", TRAVEL_COLOR.replace("var(--gcode-travel-color, ", "").replace(")", ""));
const extColor = cssVar("--gcode-extrusion-color", EXT_COLOR);
const travColor = cssVar("--gcode-travel-color", TRAVEL_COLOR);
this._extSegs = mk(extPos, extColor);
this._travelSegs = mk(travPos, travColor);