summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-03-18 14:00:53 +0100
committerTor Andersson <tor@ccxvii.net>2024-03-18 14:20:17 +0100
commitd410829457d5f8a2a5647ea031d3e2d035a80175 (patch)
tree4e7eebbb3999b8c282f6c9e91acdfa8800b5caac /public
parent9205e584db652b8fbeab22872abd2490ead57b03 (diff)
downloadserver-d410829457d5f8a2a5647ea031d3e2d035a80175.tar.gz
Revert "Update map size dynamically (if it changes during play)."
This reverts commit 277fdc3dc71de71d1996586b5f0b56bee1c60bf1.
Diffstat (limited to 'public')
-rw-r--r--public/common/client.js24
1 files changed, 8 insertions, 16 deletions
diff --git a/public/common/client.js b/public/common/client.js
index 0b9925c..452d71a 100644
--- a/public/common/client.js
+++ b/public/common/client.js
@@ -1009,20 +1009,15 @@ var update_zoom = function () {}
}
const map = document.getElementById("map") || e_inner.querySelector("div")
- var map_w = 1920
- var map_h = 1080
-
- function update_map_size() {
- map_w = mapwrap ? mapwrap.clientWidth : map.clientWidth
- map_h = mapwrap ? mapwrap.clientHeight : map.clientHeight
- if (e_scroll.dataset.mapHeight)
- map_h = Number(e_scroll.dataset.mapHeight)
- if (e_scroll.dataset.mapWidth)
- map_w = Number(e_scroll.dataset.mapWidth)
- console.log("UPDATE MAP SIZE", map_w, map_h)
- }
+ var map_w = mapwrap ? mapwrap.clientWidth : map.clientWidth
+ var map_h = mapwrap ? mapwrap.clientHeight : map.clientHeight
+
+ if (e_scroll.dataset.mapHeight)
+ map_h = Number(e_scroll.dataset.mapHeight)
+ if (e_scroll.dataset.mapWidth)
+ map_w = Number(e_scroll.dataset.mapWidth)
- update_map_size()
+ console.log("INIT MAP SIZE", map_w, map_h)
var transform0 = { x: 0, y: 0, scale: 1 }
var transform1 = { x: 0, y: 0, scale: 1 }
@@ -1084,8 +1079,6 @@ var update_zoom = function () {}
// export function
toggle_zoom = function () {
- update_map_size()
-
if (transform1.scale === 1) {
if (mapwrap && window.innerWidth > 800) {
cycle_map_fit()
@@ -1105,7 +1098,6 @@ var update_zoom = function () {}
// export function
update_zoom = function () {
- update_map_size()
update_map_fit()
update_transform_on_resize()
scroll_log_to_end()