MCPcopy Create free account
hub / github.com/esengine/esengine / clamp

Function clamp

packages/fairygui/src/scroll/ScrollPane.ts:18–20  ·  view source on GitHub ↗
(value: number, min: number, max: number)

Source from the content-addressed store, hash-verified

16
17// Helper functions
18function clamp(value: number, min: number, max: number): number {
19 return Math.max(min, Math.min(max, value));
20}
21
22function clamp01(value: number): number {
23 return Math.max(0, Math.min(1, value));

Callers 7

scrollingPosXMethod · 0.70
scrollingPosYMethod · 0.70
setPosXMethod · 0.70
setPosYMethod · 0.70
handleSizeChangedMethod · 0.70
onMouseMoveMethod · 0.70
tweenUpdateMethod · 0.70

Calls 2

maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected