I am working on a script where I have to resize a div with jQuery ui controls. The resize controls works great when there is no rotation transform applied. But when you rotate the div and then resize it, the div starts moving to the bottom left or bottom right (See the animated GIF here (open the link in new tab)).
Here is the complete code: jsfiddle
Below is the code in the resize of the element.
var inner = elem.find(".inner");
var values = transform_matrix(inner);
if(values != "none"){
var innerWidth = ui.size.width/values[0];
}
else{
var innerWidth = ui.size.width;
}
inner.width(innerWidth);
var innerHeight = inner.height() * values[0];
elem.css({
height: innerHeight,
left: ui.position.left + 10,
top: ui.position.top +10,
});
controls.css({
height: innerHeight,
});
Any help will greatly be appreciated.