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: {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
emitted = 0,
|
||||
retracted = 0,
|
||||
pos = {x:0, y:0, z:0, f:0},
|
||||
lout = null,
|
||||
lout = {x:0, y:0, z:0},
|
||||
last = null,
|
||||
zpos = 0,
|
||||
bmax = 0,
|
||||
|
|
|
|||
Loading…
Reference in a new issue