minimal popper implementation for context menu placement

This commit is contained in:
dswbx
2025-01-18 09:59:10 +01:00
parent ebd4565166
commit 145b47e942
4 changed files with 53 additions and 13 deletions

View File

@@ -0,0 +1,5 @@
export function clampNumber(value: number, min: number, max: number): number {
const lower = Math.min(min, max);
const upper = Math.max(min, max);
return Math.max(lower, Math.min(value, upper));
}