fix align top bug with single widget in CAM mode

This commit is contained in:
Stewart Allen 2020-04-21 09:08:33 -04:00
commit c00c216822

View file

@ -950,7 +950,8 @@ self.kiri.copyright = exports.COPYRIGHT;
} }
function platformUpdateTopZ() { function platformUpdateTopZ() {
let camz = (MODE === MODES.CAM) && (settings.stock.z || settings.controller.alignTop); let alignTopOk = WIDGETS.length > 1 && settings.controller.alignTop;
let camz = (MODE === MODES.CAM) && (settings.stock.z || alignTopOk);
let ztop = camz ? camTopZ - settings.process.camZTopOffset : 0; let ztop = camz ? camTopZ - settings.process.camZTopOffset : 0;
forAllWidgets(function(widget) { forAllWidgets(function(widget) {
widget.setTopZ(ztop); widget.setTopZ(ztop);
@ -969,7 +970,7 @@ self.kiri.copyright = exports.COPYRIGHT;
height = parseFloat(dev.bedHeight) height = parseFloat(dev.bedHeight)
); );
SPACE.platform.setGZOff(height/2 - 0.1); SPACE.platform.setGZOff(height/2 - 0.1);
SPACE.platform.setHidden(width > 500 || depth > 500); // SPACE.platform.setHidden(width > 500 || depth > 500);
platform.update_origin(); platform.update_origin();
SPACE.scene.freeze(frozen); SPACE.scene.freeze(frozen);
} }
@ -979,7 +980,6 @@ self.kiri.copyright = exports.COPYRIGHT;
forAllWidgets(function(widget) { forAllWidgets(function(widget) {
let wp = widget.track.pos; let wp = widget.track.pos;
let wb = widget.mesh.getBoundingBox().clone(); let wb = widget.mesh.getBoundingBox().clone();
// wb.translate(widget.track.pos);
bounds.union(wb); bounds.union(wb);
}); });
return settings.bounds = bounds; return settings.bounds = bounds;