do not create do action when no widgets present. fix first retraction in part loop in some circumstances
This commit is contained in:
parent
25740004ef
commit
14e877bd2e
2 changed files with 10 additions and 1 deletions
|
|
@ -95,6 +95,9 @@ kiri.load(function(API) {
|
|||
event.on('selection.rotate', (rec) => {
|
||||
let type = "rotate";
|
||||
let widgets = API.selection.widgets(true);
|
||||
if (!widgets.length) {
|
||||
return;
|
||||
}
|
||||
let {x, y, z} = rec;
|
||||
if (!(x || y || z)) {
|
||||
return;
|
||||
|
|
@ -120,6 +123,9 @@ kiri.load(function(API) {
|
|||
return;
|
||||
}
|
||||
let widgets = API.selection.widgets(true);
|
||||
if (!widgets.length) {
|
||||
return;
|
||||
}
|
||||
let type = "scale";
|
||||
pushActions({
|
||||
redo: {
|
||||
|
|
@ -144,6 +150,9 @@ kiri.load(function(API) {
|
|||
// move complete (store updated position)
|
||||
event.on('mouse.drag.done', () => {
|
||||
let widgets = API.selection.widgets(true);
|
||||
if (!widgets.length) {
|
||||
return;
|
||||
}
|
||||
let type = "move";
|
||||
pushActions({
|
||||
redo: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue