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) => {
|
event.on('selection.rotate', (rec) => {
|
||||||
let type = "rotate";
|
let type = "rotate";
|
||||||
let widgets = API.selection.widgets(true);
|
let widgets = API.selection.widgets(true);
|
||||||
|
if (!widgets.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let {x, y, z} = rec;
|
let {x, y, z} = rec;
|
||||||
if (!(x || y || z)) {
|
if (!(x || y || z)) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -120,6 +123,9 @@ kiri.load(function(API) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let widgets = API.selection.widgets(true);
|
let widgets = API.selection.widgets(true);
|
||||||
|
if (!widgets.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let type = "scale";
|
let type = "scale";
|
||||||
pushActions({
|
pushActions({
|
||||||
redo: {
|
redo: {
|
||||||
|
|
@ -144,6 +150,9 @@ kiri.load(function(API) {
|
||||||
// move complete (store updated position)
|
// move complete (store updated position)
|
||||||
event.on('mouse.drag.done', () => {
|
event.on('mouse.drag.done', () => {
|
||||||
let widgets = API.selection.widgets(true);
|
let widgets = API.selection.widgets(true);
|
||||||
|
if (!widgets.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let type = "move";
|
let type = "move";
|
||||||
pushActions({
|
pushActions({
|
||||||
redo: {
|
redo: {
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
emitted = 0,
|
emitted = 0,
|
||||||
retracted = 0,
|
retracted = 0,
|
||||||
pos = {x:0, y:0, z:0, f:0},
|
pos = {x:0, y:0, z:0, f:0},
|
||||||
lout = null,
|
lout = {x:0, y:0, z:0},
|
||||||
last = null,
|
last = null,
|
||||||
zpos = 0,
|
zpos = 0,
|
||||||
bmax = 0,
|
bmax = 0,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue