Open ilyavolodin opened 11 years ago
I had faced the same issue with ui-resizable, what worked for me was to create a child div within the div and rotate it, that way, ui-resizable is not rotated but will resize whatever is in the child folder:
in my case .curr was the div with ui-resizable, i only wanted to rotate imges/svgs within it.
let rotate = (deg) => {
let cssVal = 'rotate(' + deg + 'deg)';
$('.curr img').css({
'transform': cssVal,
"-webkit-transform": cssVal,
"-moz-transform": cssVal,
"-ms-transform": cssVal,
"-o-transform": cssVal
});
$('.deg').val(deg + ' deg');
$('.curr svg').css(
{
'transform': cssVal,
"-webkit-transform": cssVal,
"-moz-transform": cssVal,
"-ms-transform": cssVal,
"-o-transform": cssVal
});
}
Rotating an element to 180 degrees and then resizing top handle will make it look like you are resizing from the bottom. This is due to the fact that jQuery Resizable is not aware of the rotation angle. I tried to fix it and was able to fix it for the case of 180 degree rotation, but the rest of the angles would require more time investment and quite a bit of math calculations: Here's the code that partially fixes resizable: