Files
papercrate/frontend/src/desktop/math.js
T
2025-10-28 10:41:56 +01:00

9 lines
267 B
JavaScript

export const clamp = (value, min, max) => {
if (value < min) return min;
if (value > max) return max;
return value;
};
export const formatTransform = (x, y, rotation = 0, scale = 1) =>
`translate3d(${x}px, ${y}px, 0) rotate(${rotation}deg) scale(${scale})`;