MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / clampInt

Function clampInt

src/renderers/createHighlightRenderer.ts:49–49  ·  view source on GitHub ↗
(v: number, lo: number, hi: number)

Source from the content-addressed store, hash-verified

47
48const clamp01 = (v: number): number => Math.min(1, Math.max(0, v));
49const clampInt = (v: number, lo: number, hi: number): number => Math.min(hi, Math.max(lo, v | 0));
50
51const isFiniteScissor = (s: HighlightPoint['scissor']): boolean =>
52 Number.isFinite(s.x) && Number.isFinite(s.y) && Number.isFinite(s.w) && Number.isFinite(s.h);

Callers 1

prepareFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected