Add scope opacity and a reset to the Visual panel

The Display panel is regrouped as Visual (Look, Overlay, Effects) with style
presets, a scope opacity slider and a reset to the default look. Scope
opacity is carried in share links as field 30 and as the legacy sco
parameter; 100 is the default and is left out of a link.

Co-authored-by: Sameh Khamis <[email protected]>
This commit is contained in:
Manjunath PaparajuandSameh Khamis authored and Sameh Khamis committed 2026-11-14 15:31:25 -08:00
1 parent d49d3d10cc
commit d145c30967
13 files changed
+471 -11

No files matched your search

+21
View File
@@ -89,6 +89,12 @@ let _container = null;
let _viewer = null;
let _enabled = true;
let _featherRatio = SCOPE_FEATHER_RATIO_DEFAULT;
/**
* How strongly the whole mask shows, from the Display panel's Opacity slider:
* a fade over the painted mask, separate from the altitude terminus above,
* so the terminus band and its repaint gate stay as they are.
*/
let _maskOpacity = 1;
let _resizeObserver = null;
let _dprQuery = null;
let _dprListener = null;
@@ -433,6 +439,7 @@ export function installScopeMask(viewer) {
_canvas = document.createElement('canvas');
_canvas.id = 'scope-mask';
_canvas.setAttribute('aria-hidden', 'true');
_canvas.style.opacity = String(_maskOpacity);
_container.appendChild(_canvas);
_resizeObserver = new ResizeObserver(() => draw());
_resizeObserver.observe(_container);
@@ -537,6 +544,20 @@ export function getScopeMaskFeather() {
return _featherRatio;
}
/**
* @param {number} ratio - How strongly the mask shows, 0 (clear) to 1.
* @returns {void}
*/
export function setScopeMaskOpacity(ratio) {
_maskOpacity = Math.max(0, Math.min(1, Number.isFinite(Number(ratio)) ? Number(ratio) : 1));
if (_canvas) _canvas.style.opacity = String(_maskOpacity);
}
/** @returns {number} */
export function getScopeMaskOpacity() {
return _maskOpacity;
}
/**
* Tear the mask down (canvas + observer). Reinstall with installScopeMask.
* @returns {void}