mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 02:14:01 +00:00
* feat: add scope controls and conditional HUD backplates * docs: assign scope changelog to PR 1410 * fix: stabilize title backplate and brighten secondary labels --------- Co-authored-by: Bilawal Sidhu <[email protected]>
12 lines
420 B
JavaScript
12 lines
420 B
JavaScript
/** A 200% feather reaches the center while keeping its midpoint on the keyhole. */
|
|
export const SCOPE_FEATHER_RATIO_MAX = 2;
|
|
const SCOPE_FEATHER_MAX_PCT = SCOPE_FEATHER_RATIO_MAX * 100;
|
|
|
|
/** Normalize a UI/share-link feather percentage to the supported integer range. */
|
|
export function clampScopeFeatherPct(value) {
|
|
return Math.max(
|
|
0,
|
|
Math.min(SCOPE_FEATHER_MAX_PCT, Math.round(Number(value) || 0)),
|
|
);
|
|
}
|