fix bug with supports not following a part mirror and mirror not triggering a workspace save
This commit is contained in:
parent
0ec472c8f4
commit
995e23bbca
3 changed files with 23 additions and 5 deletions
|
|
@ -490,10 +490,7 @@
|
|||
}
|
||||
|
||||
function mirrorSelection() {
|
||||
API.selection.for_widgets(function(widget) {
|
||||
widget.mirror();
|
||||
});
|
||||
SPACE.update();
|
||||
API.selection.mirror();
|
||||
}
|
||||
|
||||
function keys(o) {
|
||||
|
|
@ -540,7 +537,7 @@
|
|||
y = y - current.device.bedDepth/2 + (bounds.max.y - bounds.min.y)/2
|
||||
}
|
||||
|
||||
moveSelection(x, y, z, true);
|
||||
API.selection.move(x, y, z, true);
|
||||
}
|
||||
|
||||
function deviceExport(exp, name) {
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@
|
|||
move: moveSelection,
|
||||
scale: scaleSelection,
|
||||
rotate: rotateSelection,
|
||||
mirror: mirrorSelection,
|
||||
meshes: function() { return selectedMeshes.slice() },
|
||||
widgets: function(orall) {
|
||||
let sel = selectedMeshes.slice().map(m => m.widget);
|
||||
|
|
@ -1454,6 +1455,15 @@
|
|||
SPACE.update();
|
||||
}
|
||||
|
||||
function mirrorSelection() {
|
||||
API.selection.for_widgets(function(widget) {
|
||||
widget.mirror();
|
||||
API.event.emit("widget.mirror", widget);
|
||||
});
|
||||
SPACE.update();
|
||||
auto_save();
|
||||
}
|
||||
|
||||
function moveSelection(x, y, z, abs) {
|
||||
if (viewMode !== VIEWS.ARRANGE) return;
|
||||
forSelectedGroups(function (w) {
|
||||
|
|
|
|||
|
|
@ -294,6 +294,17 @@
|
|||
func.sclear();
|
||||
}
|
||||
});
|
||||
api.event.on("widget.mirror", widget => {
|
||||
if (!isFdmMode) {
|
||||
return;
|
||||
}
|
||||
let ann = API.widgets.annotate(widget.id);
|
||||
let sups = ann.support || [];
|
||||
sups.forEach(sup => {
|
||||
let wsup = widget.sups[sup.id];
|
||||
wsup.box.position.x = wsup.x = sup.x = -sup.x;
|
||||
});
|
||||
});
|
||||
api.event.on("widget.rotate", rot => {
|
||||
if (!isFdmMode) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue