mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-17 00:59:29 -07:00
switch from css zoom to transform-scale
This commit is contained in:
@@ -274,9 +274,9 @@ const resize = () => {
|
||||
|
||||
const scale = Math.min(widthZoomPercent, heightZoomPercent);
|
||||
if (scale < 1.0 || document.fullscreenElement) {
|
||||
document.querySelector('#container').style.zoom = scale;
|
||||
document.querySelector('#container').style.transform = `scale(${scale})`;
|
||||
} else {
|
||||
document.querySelector('#container').style.zoom = 1;
|
||||
document.querySelector('#container').style.transform = 'unset';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -167,9 +167,7 @@ class RegionalForecast extends WeatherDisplay {
|
||||
// draw the map
|
||||
const scale = 640 / (offsetXY.x * 2);
|
||||
const map = this.elem.querySelector('.map');
|
||||
map.style.zoom = scale;
|
||||
map.style.top = `-${sourceXY.y}px`;
|
||||
map.style.left = `-${sourceXY.x}px`;
|
||||
map.style.transform = `scale(${scale}) translate(-${sourceXY.x}px, -${sourceXY.y}px)`;
|
||||
|
||||
const cities = data.map((city) => {
|
||||
const fill = {};
|
||||
|
||||
Reference in New Issue
Block a user