Fixed resizing of rectangles by clicking their corners, may need some polish to work smoothly with rotated rectangles (currently works correctly, but is a bit awkward).