allow z middle anchor offsetting, mostly driven by lathe requirements

This commit is contained in:
Stewart Allen 2023-02-14 19:37:51 -05:00
commit c1386ded5c
5 changed files with 30 additions and 15 deletions

View file

@ -147,7 +147,7 @@ function platformUpdateMidZ() {
space.platform.setMaxZ(topZ);
}
function platformUpdateTopZ(zdelta) {
function platformUpdateTopZ() {
const { process, stock } = current();
const MODE = get_mode();
api.widgets.each(widget => {
@ -160,7 +160,11 @@ function platformUpdateTopZ(zdelta) {
widget.setTopZ(stock.z - zdelta);
break;
case 'middle':
widget.setTopZ(stock.z - (stock.z - wzmax) / 2);
if (widget.isIndexed) {
widget.setTopZ(zdelta);
} else {
widget.setTopZ(stock.z - (stock.z - wzmax) / 2 + zdelta);
}
break;
case 'bottom':
widget.setTopZ(wzmax + zdelta);