diff --git a/src/kiri/init.js b/src/kiri/init.js index 5b301fd3..47fdec49 100644 --- a/src/kiri/init.js +++ b/src/kiri/init.js @@ -1911,11 +1911,7 @@ if (bound.max.x + delta.x >= width) return; if (bound.max.y + delta.y >= depth) return; } - API.selection.for_widgets(function(widget) { - widget.move(delta.x, delta.y, 0); - API.event.emit('widget.move', {widget, delta}); - }); - API.selection.update_bounds(); + API.selection.move(delta.x, delta.y, 0); API.event.emit('selection.drag', delta); } else { return API.selection.meshes().length > 0; diff --git a/src/kiri/main.js b/src/kiri/main.js index d520af39..f4c18eee 100644 --- a/src/kiri/main.js +++ b/src/kiri/main.js @@ -82,8 +82,7 @@ widgets: function() { return selectedMeshes.slice().map(m => m.widget) }, for_groups: forSelectedGroups, for_meshes: forSelectedMeshes, - for_widgets: forSelectedWidgets, - update_bounds: updateSelectedBounds + for_widgets: forSelectedWidgets }; const platform = { @@ -951,10 +950,10 @@ function moveSelection(x, y, z, abs) { if (viewMode !== VIEWS.ARRANGE) return; - // setViewMode(VIEWS.ARRANGE); forSelectedGroups(function (w) { w.move(x, y, z, abs); }); + updateSelectedBounds(); API.event.emit('selection.move', {x, y, z, abs}); SPACE.update(); auto_save(); @@ -962,12 +961,12 @@ function scaleSelection() { if (viewMode !== VIEWS.ARRANGE) return; - // setViewMode(VIEWS.ARRANGE); let args = arguments; forSelectedGroups(function (w) { w.scale(...args); }); platform.compute_max_z(); + updateSelectedBounds(); API.event.emit('selection.scale', [...arguments]); // skip update if last argument is strictly 'false' if ([...arguments].pop() === false) { @@ -980,10 +979,10 @@ function rotateSelection(x, y, z) { if (viewMode !== VIEWS.ARRANGE) return; - // setViewMode(VIEWS.ARRANGE); forSelectedGroups(function (w) { w.rotate(x, y, z); }); + updateSelectedBounds(); platform.compute_max_z(); API.event.emit('selection.rotate', {x, y, z}); updateSelectedInfo();