set visual state for trace and restore on trace done

This commit is contained in:
Stewart Allen 2025-06-21 22:38:53 -04:00
commit 9be674b61c
2 changed files with 23 additions and 1 deletions

View file

@ -355,6 +355,27 @@ class Widget {
}
}
getVisualState() {
return {
edges: this.outline ? true : false,
wires: this.wire ? true : false,
opacity: this.getMaterial().opacity
};
}
setVisualState({ edges, wires, opacity}) {
this.cache.vizstate = this.getVisualState();
this.setEdges(edges ?? false);
this.setWireframe(wires ?? false);
this.setOpacity(opacity ?? 1);
}
restoreVisualState() {
if (this.cache.vizstate) {
this.setVisualState(this.cache.vizstate);
}
}
/**
* @param {number} value
*/