Public function

Clamp a value into a range.

Example
const A = clamp(0, 1) // 1
Signature
function clamp(n: number, min: number): number
Parameters
NameDescription

n

number

The number to clamp.

min

number

The minimum value.

Returns
number
Source

packages/editor/src/lib/primitives/utils.ts

Circle2dclamp