fix: map going off screen in fullscreen
Some checks failed
TrafficCue CI / check (push) Failing after 1m45s
TrafficCue CI / build (push) Successful in 1m2s

This commit is contained in:
2025-08-30 16:45:39 +02:00
parent 89c9e01b43
commit c46b158e28
2 changed files with 7 additions and 2 deletions

View File

@ -85,7 +85,10 @@
const fullHeight = window.innerHeight - 20 - 40 - 10;
if (fullscreen[view.current.type]) {
if(sidebarHeight != fullHeight) {
if(window.__TAURI__) hideSearch = true;
if(window.innerWidth < 768) {
hideSearch = true;
map.ignorePadding = true;
}
previousHeight = sidebarHeight;
sidebarHeight = fullHeight;
requestAnimationFrame(() => { map.updateMapPadding(); } );
@ -93,6 +96,7 @@
} else {
hideSearch = false;
if(sidebarHeight == fullHeight) {
map.ignorePadding = false;
sidebarHeight = previousHeight;
requestAnimationFrame(() => { map.updateMapPadding(); } );
}

View File

@ -8,8 +8,9 @@ import { view } from "./view.svelte";
export const map = $state({
value: undefined as maplibregl.Map | undefined,
zoom: 0,
ignorePadding: false,
updateMapPadding: () => {
if (document.querySelector<HTMLDivElement>("#sidebar") == null) {
if (document.querySelector<HTMLDivElement>("#sidebar") == null || map.ignorePadding) {
map._setPadding({
top: 0,
right: 0,