Procházet zdrojové kódy

Fix the scale showing the wrong units

Units that didn't match the internal base unit
were showing up wrongly.
master
Fen Dweller před 5 roky
rodič
revize
8dec391e4b
1 změnil soubory, kde provedl 3 přidání a 2 odebrání
  1. +3
    -2
      macrovision.js

+ 3
- 2
macrovision.js Zobrazit soubor

@@ -282,6 +282,7 @@ function drawScale(ifDirty = false) {
return; return;
function drawTicks(/** @type {CanvasRenderingContext2D} */ ctx, pixelsPer, heightPer) { function drawTicks(/** @type {CanvasRenderingContext2D} */ ctx, pixelsPer, heightPer) {
let total = heightPer.clone(); let total = heightPer.clone();
console.log(total)
total.value = 0; total.value = 0;
for (let y = ctx.canvas.clientHeight - 50; y >= 50; y -= pixelsPer) { for (let y = ctx.canvas.clientHeight - 50; y >= 50; y -= pixelsPer) {
drawTick(ctx, 50, y, total); drawTick(ctx, 50, y, total);
@@ -345,7 +346,7 @@ function drawScale(ifDirty = false) {
pixelsPer /= factor; 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); ctx.scale(1, 1);
@@ -832,7 +833,7 @@ function configViewOptions(entity, view) {
}) })


select.setAttribute("oldUnit", select.value); select.setAttribute("oldUnit", select.value);
setNumericInput(input, entity.views[view][key].toNumber(select.value)); setNumericInput(input, entity.views[view][key].toNumber(select.value));


// TODO does this ever cause a change in the world? // TODO does this ever cause a change in the world?


Načítá se…
Zrušit
Uložit