mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
round river length on UI
This commit is contained in:
parent
b098865bdf
commit
9604d4ae41
2 changed files with 3 additions and 3 deletions
|
|
@ -170,7 +170,7 @@
|
||||||
const widthFactor = !parent || parent === riverId ? 1.2 : 1;
|
const widthFactor = !parent || parent === riverId ? 1.2 : 1;
|
||||||
const meanderedPoints = addMeandering(riverCells);
|
const meanderedPoints = addMeandering(riverCells);
|
||||||
const discharge = cells.fl[mouth]; // m3 in second
|
const discharge = cells.fl[mouth]; // m3 in second
|
||||||
const length = getApproximateLength(meanderedPoints);
|
const length = rn(getApproximateLength(meanderedPoints), 2);
|
||||||
const width = getWidth(getOffset(discharge, meanderedPoints.length, widthFactor, 0));
|
const width = getWidth(getOffset(discharge, meanderedPoints.length, widthFactor, 0));
|
||||||
|
|
||||||
pack.rivers.push({i: riverId, source, mouth, discharge, length, width, widthFactor, sourceWidth: 0, parent, cells: riverCells});
|
pack.rivers.push({i: riverId, source, mouth, discharge, length, width, widthFactor, sourceWidth: 0, parent, cells: riverCells});
|
||||||
|
|
|
||||||
|
|
@ -78,8 +78,8 @@ function editRiver(id) {
|
||||||
|
|
||||||
function updateRiverLength(river) {
|
function updateRiverLength(river) {
|
||||||
river.length = rn(elSelected.node().getTotalLength() / 2, 2);
|
river.length = rn(elSelected.node().getTotalLength() / 2, 2);
|
||||||
const length = `${river.length * distanceScaleInput.value} ${distanceUnitInput.value}`;
|
const lengthUI = `${rn(river.length * distanceScaleInput.value)} ${distanceUnitInput.value}`;
|
||||||
document.getElementById("riverLength").value = length;
|
document.getElementById("riverLength").value = lengthUI;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateRiverWidth(river) {
|
function updateRiverWidth(river) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue