allow sketch items to be up-click targeted
This commit is contained in:
parent
63620bfcbe
commit
9d991b0a97
3 changed files with 13 additions and 2 deletions
|
|
@ -336,7 +336,12 @@ function space_init(data) {
|
|||
return event && event.shiftKey ? api.objects() : undefined;
|
||||
});
|
||||
|
||||
space.mouse.upSelect((int, event) => {
|
||||
space.mouse.upSelect((int, event, ints) => {
|
||||
if (ints?.length > 1) {
|
||||
// ensure sketch items are returned before sketch plane / handles
|
||||
let polys = ints.filter(i => i.object.poly);
|
||||
int = polys.length ? polys[0] : int;
|
||||
}
|
||||
if (event && event.target.nodeName === "CANVAS") {
|
||||
const model = int?.object?.model;
|
||||
const sketch = int?.object?.sketch;
|
||||
|
|
@ -397,6 +402,11 @@ function space_init(data) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
let sketches = api.selection.sketches(true);
|
||||
if (sketches.length) {
|
||||
// when sketch selected, return sketch items, too
|
||||
return sketches[0].object.children;
|
||||
};
|
||||
return api.objects().filter(o => o.visible);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -235,6 +235,7 @@ mesh.sketch = class MeshSketch extends mesh.object {
|
|||
let geo = new BufferGeometry();
|
||||
geo.setAttribute('position', new BufferAttribute(vrt, 3));
|
||||
let meh = new Mesh(geo, mesh.material.normal);
|
||||
meh.renderOrder = -1;
|
||||
meh.poly = poly;
|
||||
group.add(meh);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -949,7 +949,7 @@ gapp.register("moto.space", [], (root, exports) => {
|
|||
}
|
||||
}
|
||||
if (int.length > 0) {
|
||||
mouseUpSelect(int[0], event);
|
||||
mouseUpSelect(int[0], event, int);
|
||||
refresh = true;
|
||||
} else {
|
||||
mouseUpSelect(null, event);
|
||||
|
|
|
|||
Loading…
Reference in a new issue