Added method to identify the mouse position in the redrawing of the rectangle.

Signed-off-by: Johan Fredriksson <johanfredriksson1987@gmail.com>