From 2156ab0760fcb1905ca6f6e3c3f84460513f3c1e Mon Sep 17 00:00:00 2001 From: Pyro Nicampt <81565698+PyroNicampt@users.noreply.github.com> Date: Sat, 4 Jan 2025 01:34:10 -0600 Subject: [PATCH] Force redraw on zoom to fix HW Accel blur --- index.html | 2 +- index.js | 6 ++++++ style.css | 9 +++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 1dee6c5..c079a32 100644 --- a/index.html +++ b/index.html @@ -230,7 +230,7 @@
- DV Community Map + DV Community Map
diff --git a/index.js b/index.js index 85ae8f5..81f3648 100644 --- a/index.js +++ b/index.js @@ -56,6 +56,7 @@ const zoomLevelDisplay = document.getElementById('zoomLevelDisplay'); const zoomStyle = document.getElementById('zoomStyle'); const styleRoot = document.querySelector(':root'); const svgns = map.getAttribute('xmlns'); +const redrawTriggerElement = document.getElementById('redrawTrigger'); const map_rails = document.createElementNS(svgns, 'g'); map_rails.setAttribute('id', 'map_rails'); @@ -256,9 +257,14 @@ function updateMapview(){ zoomStyle.innerHTML = dynamicStyles.join('\n'); } previousMapScale = mapNav.scale; + forceRedraw(); } } +function forceRedraw(){ + redrawTriggerElement.style.backgroundColor = Color.random().hex; +} + /** Get the bounding box of all the tracks, and set the map bounds accordingly. Also flips the Y axis. * **Note:** Does NOT evaluate beziers, uses the control points only. */ diff --git a/style.css b/style.css index 7819516..3cfa957 100644 --- a/style.css +++ b/style.css @@ -99,6 +99,15 @@ a:visited{ pointer-events: all; } +#redrawTrigger{ + transition: background-color 800ms; + display: inline-block; + width: 1px; + height: 5px; + background-color: #000; + opacity: 0.01; +} + #settingsPanel{ user-select: none; input, label{