remove old object bounds, persist new bounds state

This commit is contained in:
Stewart Allen 2025-06-17 15:40:47 -04:00
commit d6e88e7461
4 changed files with 21 additions and 44 deletions

View file

@ -25,10 +25,11 @@ class TransformTool {
this.lines = []; // Add array to track connecting lines
this.mode = '2d'; // or '3d'
this.bounds = null;
this.handleSize = 2; // Fixed size in world units
this.handleSize = 2;
this.handleColor = 0x0088ff;
this.handleOpacity = 0.5;
this.visible = false;
this.visible = true;
// Create materials
this.handleMaterial = new MeshBasicMaterial({
@ -66,14 +67,25 @@ class TransformTool {
});
}
setVisible(visible) {
this.visible = visible;
this.group.visible = this.visible;
if (meshApi && meshApi.prefs) {
meshApi.prefs.map.space.bounds = this.visible;
meshApi.prefs.save();
}
}
show() {
this.visible = true;
this.group.visible = true;
this.setVisible(true);
}
hide() {
this.visible = false;
this.group.visible = false;
this.setVisible(false);
}
toggleBounds() {
this.setVisible(!this.visible);
}
update() {
@ -88,9 +100,6 @@ class TransformTool {
return;
}
// Show transform tool
this.show();
// Get bounds based on selection type
let bounds;
if (sketch) {