compensate WireEDM previews when origin bounds checked

This commit is contained in:
Stewart Allen 2024-06-13 22:13:03 -04:00
commit 4d811972f6
4 changed files with 18 additions and 6 deletions

View file

@ -83,10 +83,18 @@ function init(kiri, api, driver) {
}
});
api.event.on("mode.set", (mode) => {
});
// api.event.on("mode.set", (mode) => { });
api.event.on("view.set", (mode) => {
// api.event.on("view.set", (mode) => { });
api.event.on("preview.view", view => {
const process = api.conf.get().process;
if (!process.ctOriginBounds) return;
const bounds = new THREE.Box3().expandByObject(view);
api.platform.set_bounds(new THREE.Box3(
new THREE.Vector3(bounds.min.x, bounds.min.z, bounds.min.y),
new THREE.Vector3(bounds.max.x, bounds.max.z, bounds.max.y),
));
});
// Surface Selection Buttons