correct plane position, limit to selection

This commit is contained in:
Stewart Allen 2022-01-15 14:02:03 -05:00
commit 61979657f1

View file

@ -155,18 +155,19 @@ let split = {
let state = split.state = { button, obj }; let state = split.state = { button, obj };
// for split and lay flat modes // for split and lay flat modes
space.mouse.onHover((int, event, ints) => { space.mouse.onHover((int, event, ints) => {
let models = api.selection.models().map(m => m.mesh);
if (!event) { if (!event) {
return api.objects(); return models;
} }
let { button, buttons } = event; let { button, buttons } = event;
if (buttons) { if (buttons) {
return; return;
} }
let { dim, mid } = util.bounds(int.object); let { dim, mid } = util.bounds(models);
let { x, y, z } = int.point; let { x, y, z } = int.point;
state.point = { x, y, z }; state.point = { x, y, z };
obj.scale.set(dim.x, dim.y, 1); obj.scale.set(dim.x, dim.y, 1);
obj.position.set(mid.x, y, mid.y); obj.position.set(mid.x, y, -mid.y);
}); });
temp_mode = split; temp_mode = split;
}, },