mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 20:37:21 +00:00
minimal popper implementation for context menu placement
This commit is contained in:
5
app/src/core/utils/numbers.ts
Normal file
5
app/src/core/utils/numbers.ts
Normal 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));
|
||||
}
|
||||
Reference in New Issue
Block a user