fix sketch centering
This commit is contained in:
parent
4d8622eed6
commit
8c9ff300dc
2 changed files with 10 additions and 2 deletions
|
|
@ -293,7 +293,7 @@ const selection = {
|
|||
},
|
||||
|
||||
focus() {
|
||||
api.focus(selection.list());
|
||||
selection.count() && api.focus(selection.list());
|
||||
},
|
||||
|
||||
bounds() {
|
||||
|
|
@ -1537,7 +1537,10 @@ const api = {
|
|||
if (isNaN(center.x * center.y * center.z)) {
|
||||
center = { x: 0, y: 0, z: 0 };
|
||||
}
|
||||
let { normal } = Array.isArray(object) ? object[0].object : object.object;
|
||||
let { normal } = Array.isArray(object) && object.length ?
|
||||
object[0].object :
|
||||
object.object ||
|
||||
{ };
|
||||
let left, up;
|
||||
if (normal) {
|
||||
let { x, y, z } = normal;
|
||||
|
|
|
|||
|
|
@ -118,6 +118,11 @@ class MeshSketch extends meshObject {
|
|||
return this.group;
|
||||
}
|
||||
|
||||
get bounds() {
|
||||
this.plane.geometry.computeBoundingBox();
|
||||
return this.plane.geometry.boundingBox.clone();
|
||||
}
|
||||
|
||||
get meshes() {
|
||||
return this.group.children.filter(c => {
|
||||
return c.sketch || (c.sketch_item && c.sketch_item.selected) ? c : undefined
|
||||
|
|
|
|||
Loading…
Reference in a new issue