ensure widgets are on platform when changing devices or modes
This commit is contained in:
parent
9d37b2e678
commit
c53741169e
1 changed files with 8 additions and 4 deletions
|
|
@ -84,6 +84,7 @@
|
||||||
for_groups: forSelectedGroups,
|
for_groups: forSelectedGroups,
|
||||||
for_meshes: forSelectedMeshes,
|
for_meshes: forSelectedMeshes,
|
||||||
for_widgets: forSelectedWidgets,
|
for_widgets: forSelectedWidgets,
|
||||||
|
update_bounds: updateSelectedBounds,
|
||||||
delete: function() { platform.delete(selection.widgets()) },
|
delete: function() { platform.delete(selection.widgets()) },
|
||||||
export: exportSelection
|
export: exportSelection
|
||||||
};
|
};
|
||||||
|
|
@ -1202,13 +1203,16 @@
|
||||||
updateSelectedBounds();
|
updateSelectedBounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSelectedBounds() {
|
function updateSelectedBounds(widgets) {
|
||||||
// update bounds on selection for drag limiting
|
// update bounds on selection for drag limiting
|
||||||
let isBelt = settings.device.bedBelt;
|
let isBelt = settings.device.bedBelt;
|
||||||
let dvy = settings.device.bedDepth;
|
let dvy = settings.device.bedDepth;
|
||||||
let dvx = settings.device.bedWidth;
|
let dvx = settings.device.bedWidth;
|
||||||
let bounds_sel = new THREE.Box3();
|
let bounds_sel = new THREE.Box3();
|
||||||
forSelectedWidgets(function(widget) {
|
if (!widgets) {
|
||||||
|
widgets = selectedMeshes.map(m => m.widget);
|
||||||
|
}
|
||||||
|
for (let widget of widgets) {
|
||||||
let wp = widget.track.pos;
|
let wp = widget.track.pos;
|
||||||
let bx = widget.track.box;
|
let bx = widget.track.box;
|
||||||
let miny = wp.y - bx.h/2 + dvy/2;
|
let miny = wp.y - bx.h/2 + dvy/2;
|
||||||
|
|
@ -1238,7 +1242,7 @@
|
||||||
wb.min.y += wp.y;
|
wb.min.y += wp.y;
|
||||||
wb.max.y += wp.y;
|
wb.max.y += wp.y;
|
||||||
bounds_sel.union(wb);
|
bounds_sel.union(wb);
|
||||||
});
|
}
|
||||||
settings.bounds_sel = bounds_sel;
|
settings.bounds_sel = bounds_sel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2489,7 +2493,6 @@
|
||||||
complete = {};
|
complete = {};
|
||||||
UI.back.style.display = '';
|
UI.back.style.display = '';
|
||||||
UI.render.style.display = '';
|
UI.render.style.display = '';
|
||||||
// UI.render.classList.add('lt-enabled');
|
|
||||||
// KIRI.work.clear();
|
// KIRI.work.clear();
|
||||||
STACKS.clear();
|
STACKS.clear();
|
||||||
hideSlider();
|
hideSlider();
|
||||||
|
|
@ -2570,6 +2573,7 @@
|
||||||
// other housekeeping
|
// other housekeeping
|
||||||
triggerSettingsEvent();
|
triggerSettingsEvent();
|
||||||
platformUpdateSelected();
|
platformUpdateSelected();
|
||||||
|
updateSelectedBounds(WIDGETS);
|
||||||
updateFields();
|
updateFields();
|
||||||
// because device dialog, if showing, needs to be updated
|
// because device dialog, if showing, needs to be updated
|
||||||
if (modalShowing()) {
|
if (modalShowing()) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue