handle sketch and sketch item move undo/redo
This commit is contained in:
parent
db66a13580
commit
4d8622eed6
4 changed files with 62 additions and 33 deletions
|
|
@ -395,8 +395,20 @@ class MeshSketch extends meshObject {
|
|||
return bool;
|
||||
}
|
||||
|
||||
move(x, y, z = 0) {
|
||||
position() {
|
||||
const { target } = drag;
|
||||
console.log({ sk_pos: [ ...arguments ], target });
|
||||
const [ nx, ny, nz ] = [ ...arguments ];
|
||||
if (nx || ny || nz) {
|
||||
this.center = { x: nx, y: ny, z: nz };
|
||||
this.render();
|
||||
} else {
|
||||
const { x, y, z } = this.center;
|
||||
return new Vector3(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
move(x, y, z = 0, target = drag.target) {
|
||||
const { center, scale, plane, handles } = this;
|
||||
const handle = handles.indexOf(target);
|
||||
if (target === plane) {
|
||||
|
|
@ -636,4 +648,8 @@ class SketchItem {
|
|||
}
|
||||
}
|
||||
|
||||
export { MeshSketch as sketch, SketchItem };
|
||||
function target() {
|
||||
return drag.target;
|
||||
}
|
||||
|
||||
export { MeshSketch as sketch, SketchItem, target };
|
||||
Loading…
Reference in a new issue