The geometry values of your rectangle are fixed and do not use the values you get from the mouse.

Cheers,
_