MCPcopy Index your code
hub / github.com/CapSoftware/Cap / ratioToValue

Function ratioToValue

apps/desktop/src/components/Cropper.tsx:93–93  ·  view source on GitHub ↗
(r: Ratio)

Source from the content-addressed store, hash-verified

91const ORIGIN_CENTER: Vec2 = { x: 0.5, y: 0.5 };
92
93const ratioToValue = (r: Ratio) => r[0] / r[1];
94const clamp = (n: number, min = 0, max = 1) => Math.max(min, Math.min(max, n));
95const easeInOutCubic = (t: number) =>
96 t < 0.5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2;

Callers 2

CropperFunction · 0.85
computeFreeResizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected