release: bump version to 0.40.4
This commit is contained in:
@@ -242,6 +242,7 @@ let activeTouchPoints = new Map();
|
||||
let pinchGesture = null;
|
||||
let pointerDragDistance = 0;
|
||||
let suppressNextClick = false;
|
||||
let shouldRefreshSatellitesAfterVisibilityResume = false;
|
||||
|
||||
const clock = new THREE.Clock();
|
||||
const interactionRaycaster = new THREE.Raycaster();
|
||||
@@ -2392,6 +2393,7 @@ export async function setSatellitesEnabled(
|
||||
|
||||
function setupEventListeners() {
|
||||
const handleResize = () => onWindowResize();
|
||||
const handleVisibilityChange = () => onVisibilityChange();
|
||||
const handlePointerMove = (event) => onPointerMove(event);
|
||||
const handlePointerDown = (event) => onPointerDown(event);
|
||||
const handlePointerUp = (event) => onPointerUp(event);
|
||||
@@ -2403,6 +2405,7 @@ function setupEventListeners() {
|
||||
const handleInfoCardDrag = () => repositionCruiseConnector();
|
||||
|
||||
bindListener(window, "resize", handleResize);
|
||||
bindListener(document, "visibilitychange", handleVisibilityChange);
|
||||
bindListener(window, "pagehide", handlePageHide);
|
||||
bindListener(window, "beforeunload", handlePageHide);
|
||||
bindListener(window, "earth:rotation-mode-change", handleRotationMode);
|
||||
@@ -2425,6 +2428,20 @@ function setupEventListeners() {
|
||||
}
|
||||
}
|
||||
|
||||
function onVisibilityChange() {
|
||||
if (document.hidden) {
|
||||
shouldRefreshSatellitesAfterVisibilityResume = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!shouldRefreshSatellitesAfterVisibilityResume) return;
|
||||
shouldRefreshSatellitesAfterVisibilityResume = false;
|
||||
|
||||
// Drop the elapsed background time so the next RAF does not replay it.
|
||||
clock.getDelta();
|
||||
updateSatellitePositions(0, true, { resetTrails: true });
|
||||
}
|
||||
|
||||
function updateHudScale() {
|
||||
const widthScale = window.innerWidth / HUD_CONFIG.scaleReferenceWidth;
|
||||
const heightScale = window.innerHeight / HUD_CONFIG.scaleReferenceHeight;
|
||||
|
||||
Reference in New Issue
Block a user