fix autosave on widget drag
This commit is contained in:
parent
82421c11cc
commit
2370702464
2 changed files with 5 additions and 10 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue