reverse belt X axis label order fixes #149

This commit is contained in:
Stewart Allen 2022-10-12 17:38:55 -04:00
commit 03d5c87057
2 changed files with 14 additions and 5 deletions

View file

@ -878,6 +878,7 @@ gapp.register("kiri.init", [], (root, exports) => {
ui.deviceAdd.disabled = dev.noclone;
api.conf.update_fields();
space.platform.setBelt(isBelt());
platform.update_size();
platform.update_origin();
platform.update();

View file

@ -104,6 +104,7 @@ gapp.register("moto.space", [], (root, exports) => {
platformOnMove,
platformOnMoveTime = 500,
platformMoveTimer,
platformBelt = false,
volume,
camera,
renderer,
@ -470,12 +471,18 @@ gapp.register("moto.space", [], (root, exports) => {
mesh = canvas.mesh;
if (!(context && mesh)) return;
if (platformBelt) {
for (let i = 0; i <= ruler.x2; i += grid.unitMajor) {
context.fillText((i * factor).round(1).toString(), ruler.x2 - i + xPadding / 2, 0);
}
} else {
for (let i = 0; i >= ruler.x1; i -= grid.unitMajor) {
context.fillText((i * factor).round(1).toString(), ruler.xo + i + xPadding / 2, 0);
}
for (let i = 0; i <= ruler.x2; i += grid.unitMajor) {
context.fillText((i * factor).round(1).toString(), ruler.xo + i + xPadding / 2, 0);
}
}
context.font = (labelSize * 0.75) + 'px sans-serif';
context.fillText(xlabel, (x + xPadding) / 2, labelSize * 1.5);
@ -1178,6 +1185,7 @@ gapp.register("moto.space", [], (root, exports) => {
setHiding: (b) => { hidePlatformBelow = b },
setZOff: (z) => { platformZOff = z; updatePlatformPosition() },
setGridZOff:(z) => { gridZOff = z; updatePlatformPosition() },
setBelt: (b) => { platformBelt = b },
isHidden: () => { return !showPlatform },
isVisible: () => { return platform.visible },
isGridVisible() { return grid.view.visible },