Fixed the rotation and resizing issues related to border width.