소스 검색

Fix changing area units causing an object's size to change

The default displayed unit was cm^2, but it was m^2 internally -
so it would wind up shrinking if you went to m^2. This needs to be
fixed more generally, though - it should be able to start at any unit
and still work properly.
tags/v0.0.6
Fen Dweller 5 년 전
부모
커밋
1ec437157e
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. +3
    -3
      macrovision.js

+ 3
- 3
macrovision.js 파일 보기

@@ -23,8 +23,8 @@ const unitChoices = {
"parsecs",
],
area: [
"cm^2",
"meters^2",
"cm^2",
"kilometers^2",
"acres",
"miles^2"
@@ -500,8 +500,8 @@ function updateViewOptions(entity, view, changed) {
const input = document.querySelector("#options-view-" + key + "-input");
const select = document.querySelector("#options-view-" + key + "-select");
const currentUnit = select.value;
const convertedAmount = entity.views[view][key].to(currentUnit);
input.value = math.round(convertedAmount.value, 5);
const convertedAmount = entity.views[view][key].toNumber(currentUnit);
input.value = math.round(convertedAmount, 5);
}

});


불러오는 중...
취소
저장