diff --git a/src2/main/mesh.js b/src2/main/mesh.js index 5bedb518..2ad2a6fe 100644 --- a/src2/main/mesh.js +++ b/src2/main/mesh.js @@ -371,11 +371,7 @@ function space_init(data) { let obj = int?.object; if (obj) api.selection.drag({ start: int.object }); if (obj) obj.sketch_item?.sketch.drag({ start: int.object }); - if (event?.shiftKey) { - return api.objects(); - } else { - return undefined; - } + return event?.shiftKey ? undefined : api.objects(selection.count() ? true : false); }); // called two ways: @@ -477,7 +473,8 @@ function space_init(data) { space.mouse.onDrag((delta, offset, up = false) => { let { mode, modes } = api; if (delta) { - if (delta.event?.shiftKey && selection.count()) { + // if (delta.event?.shiftKey && selection.count()) { + if (selection.count()) { selection.drag({ delta, offset }); } } else if (up) { diff --git a/src2/mesh/api.js b/src2/mesh/api.js index 30c1a453..6bdc47a9 100644 --- a/src2/mesh/api.js +++ b/src2/mesh/api.js @@ -1597,12 +1597,19 @@ const api = { prefs.save( prefs.map.space.norm = norm ); }, - objects() { + objects(selected = false) { // return model objects suitable for finding ray intersections - return [ - ...group.list().map(o => o.models).flat().map(o => o.mesh), - ...sketches.map(s => s.meshes).flat() - ]; + if (selected) { + return [ + ...selection.models().map(o => o.mesh), + ...selection.sketches().map(s => s.meshes).flat() + ]; + } else { + return [ + ...group.list().map(o => o.models).flat().map(o => o.mesh), + ...sketches.map(s => s.meshes).flat() + ]; + } }, add, diff --git a/src2/moto/space.js b/src2/moto/space.js index 7c90ab76..54a7c4d4 100644 --- a/src2/moto/space.js +++ b/src2/moto/space.js @@ -865,7 +865,9 @@ function onMouseDown(event) { let selection = null, trackTo = alignedTracking ? trackPlane : platform, isVis = trackTo.visible; - if (mouseDownSelect) selection = mouseDownSelect(undefined, event); + if (mouseDownSelect) { + selection = mouseDownSelect(undefined, event); + } if (selection && selection.length > 0) { // selection = selection.map(o => o.isGroup ? o.children : o).flat(); // console.log({ selection });