do not create do action when no widgets present. fix first retraction in part loop in some circumstances

This commit is contained in:
Stewart Allen 2021-10-21 23:47:21 -04:00
commit 14e877bd2e
2 changed files with 10 additions and 1 deletions

View file

@ -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: {

View file

@ -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,