Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const newWidth = width - changedWidth;
const changedHeight = height * (1 - scaleY);
const newHeight = height - changedHeight;
let transformMatrix;
if(disableScale === false){
transformMatrix = transform(
translate(roundTo(x + changedWidth / 2), roundTo(y + changedHeight / 2)),
rotate(angle * (Math.PI / 180)),
scale(scaleX, scaleY)
);
}else{
transformMatrix = transform(
translate(roundTo(x + changedWidth ), roundTo(y + changedHeight )),
rotate(angle * (Math.PI / 180)),
);
width = newWidth;
height = newHeight;
}
return {
element: {
width,
height,
transform: toCSS(transformMatrix),
position: "absolute",
},
controls: {
width: newWidth,
height: newHeight,
transform: toCSS(