I'm trying to rotate an svg and running into an issue with Chrome (version 36) where the rotated image is clipped.
http://jsfiddle.net/7ehkdufj/5/
var rotation = 0;
$('#rotate').on('click', function() {
rotation = (rotation + 60) % 360;
$('.piece').css('transform', 'rotate(' + rotation + 'deg)');
});
$('#reverse').on('click', function() {
rotation = (rotation - 60) % 360;
$('.piece').css('transform', 'rotate(' + rotation + 'deg)');
});
When I use the previous code to rotate the image sometimes gets clipped (in the jsfiddle example it happens on 90 and 270 degree rotations). If I use the 'reverse' rotation then I don't see any clipping. When the image is clipped it will "fix" itself when I click on it. I think it has something to do with refreshing the screen.
Has anyone seen this issue before? Is there some type of workaround?
Update:
Adding a brief transition seems to compensate or hide the issue:
-moz-transition: all 0.01s ease;
-webkit-transition: all 0.01s ease;
-o-transition: all 0.01s ease;
transition: all 0.01s ease;