From bd21aa6d8ead310811dab09eaa09e80feb021b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Gergely?= Date: Sat, 7 May 2022 18:00:12 +0200 Subject: [PATCH] FIX: keep original burg population after submapping --- modules/submap.js | 1 + modules/ui/submap.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/submap.js b/modules/submap.js index 6ec6d2e9..dde13a19 100644 --- a/modules/submap.js +++ b/modules/submap.js @@ -367,6 +367,7 @@ window.Submap = (function () { pack.burgs.forEach((b, id) => { if (id == 0) return; // skip empty city of neturals [b.x, b.y] = projection(b.x, b.y); + b.population = b.population * options.scale; // adjust for populationRate change // disable out-of-map (removed) burgs if (!inMap(b.x, b.y)) { diff --git a/modules/ui/submap.js b/modules/ui/submap.js index a2fae5f7..1ed9847b 100644 --- a/modules/ui/submap.js +++ b/modules/ui/submap.js @@ -120,7 +120,8 @@ window.UISubmap = (function () { rescaleStyles: checked("submapRescaleStyles"), smoothHeightMap: scale > 2, inverse: (x, y) => [x / origScale + x0, y / origScale + y0], - projection: (x, y) => [(x - x0) * origScale, (y - y0) * origScale] + projection: (x, y) => [(x - x0) * origScale, (y - y0) * origScale], + scale: origScale, }; // converting map position on the planet