I am applying a CSS transform (and the browser specific -webkit, -o etc):
transform: matrix(0.5 , 0 , 0, 0.5, 0 , 0);
to a div then using jQuery\'s draggable
For different resize corner
$('.rect-item').resizable({
handles: 'n,e,s,w,ne,se,sw,nw',
resize: (e, ui) => {
const zoomScale = Your scale;
const changeWidth = ui.size.width - ui.originalSize.width; // find change in width
const newWidth = ui.originalSize.width + changeWidth / zoomScale; // adjust new width by our zoomScale
const changeHeight = ui.size.height - ui.originalSize.height; // find change in height
const newHeight = ui.originalSize.height + changeHeight / zoomScale; // adjust new height by our zoomScale
ui.size.width = newWidth;
ui.size.height = newHeight;
// here
const posOrigin = ui.originalPosition;
if (posOrigin.left !== ui.position.left) {
ui.position.left = posOrigin.left - changeWidth / zoomScale;
}
if (posOrigin.top !== ui.position.top) {
ui.position.top = posOrigin.top - changeHeight / zoomScale;
}
}
});