Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function scaleMatrix(
state: MoveableManagerState,
scale: number[],
) {
const {
transformOrigin,
offsetMatrix,
is3d,
targetMatrix,
} = state;
const n = is3d ? 4 : 3;
return getNextMatrix(
offsetMatrix,
multiply(targetMatrix, createScaleMatrix(scale, n), n),
transformOrigin,
n,
);
}
export function getScaleDist(
const xAlign = (align - 2) % 3;
const yAlign = Math.floor((align - 2) / 3);
svgOrigin[0] = viewBoxWidth * xAlign / 2;
svgOrigin[1] = viewBoxHeight * yAlign / 2;
const scaleDimension = meetOrSlice === 2 ? Math.max(scaleY, scaleX) : Math.min(scaleX, scaleY);
scale[0] = scaleDimension;
scale[1] = scaleDimension;
translate[0] = (clientWidth - viewBoxWidth) / 2 * xAlign;
translate[1] = (clientHeight - viewBoxHeight) / 2 * yAlign;
}
const scaleMatrix = createScaleMatrix(scale, n);
[
scaleMatrix[n - 1],
scaleMatrix[2 * n - 1],
] = translate;
return getAbsoluteMatrix(
scaleMatrix,
n,
svgOrigin,
);
}
export function getSVGGraphicsOffset(