handle selection undo/redo rotations better
This commit is contained in:
parent
bd97a467cf
commit
ef88a1be9a
1 changed files with 5 additions and 4 deletions
|
|
@ -92,21 +92,22 @@ kiri.load(function(API) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// selection event (store position)
|
// selection event (store position)
|
||||||
event.on('widget.rotate', (rec) => {
|
event.on('selection.rotate', (rec) => {
|
||||||
let type = "rotate";
|
let type = "rotate";
|
||||||
let {widget, x, y, z} = rec;
|
let widgets = API.selection.widgets(true);
|
||||||
|
let {x, y, z} = rec;
|
||||||
if (!(x || y || z)) {
|
if (!(x || y || z)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pushActions({
|
pushActions({
|
||||||
redo: {
|
redo: {
|
||||||
type,
|
type,
|
||||||
widgets: [ widget ],
|
widgets,
|
||||||
x, y, z
|
x, y, z
|
||||||
},
|
},
|
||||||
undo: {
|
undo: {
|
||||||
type,
|
type,
|
||||||
widgets: [ widget ],
|
widgets,
|
||||||
x: -x, y: -y, z: -z
|
x: -x, y: -y, z: -z
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue