From 8dec391e4b5551f77d2156cd2b5b72edea46da95 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sat, 9 May 2020 17:24:34 -0400 Subject: [PATCH] Fix the scale showing the wrong units Units that didn't match the internal base unit were showing up wrongly. --- macrovision.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/macrovision.js b/macrovision.js index d03e7a75..d59cd7d3 100644 --- a/macrovision.js +++ b/macrovision.js @@ -282,6 +282,7 @@ function drawScale(ifDirty = false) { return; function drawTicks(/** @type {CanvasRenderingContext2D} */ ctx, pixelsPer, heightPer) { let total = heightPer.clone(); + console.log(total) total.value = 0; for (let y = ctx.canvas.clientHeight - 50; y >= 50; y -= pixelsPer) { drawTick(ctx, 50, y, total); @@ -345,7 +346,7 @@ function drawScale(ifDirty = false) { pixelsPer /= factor; } - heightPer = math.unit(heightPer, config.height.units[0].unit.name) + heightPer = math.unit(heightPer, document.querySelector("#options-height-unit").value); ctx.scale(1, 1); @@ -832,7 +833,7 @@ function configViewOptions(entity, view) { }) select.setAttribute("oldUnit", select.value); - + setNumericInput(input, entity.views[view][key].toNumber(select.value)); // TODO does this ever cause a change in the world?