I need draw rectangle in canvas.
I know how to draw. But I did not get to do so would draw on a 360-degree
Example. blue, lilac, green they are one and the same rectangle, I changed the color for example
Red point is start position rectangle.

EDIT:
My actions:
LeftMouseDown in x=50;y=50 (press)
MoveMouse to 100;100 – now it works
MoveMouse to 30;150 or MoveMouse to 10;10 – Now I can not do this, but I need it
Unless you need a rotated rectangle I wouldn’t bother using transforms. Just set Left and Top to the minimum x and y and width to max-x and height maxy-y.