fix wrong size when adjusting the rect shape around
honor rotation when resizing
add comments to the code
code cleanup
mark with override