Bind event handler for mouseup in the 'drawRect' method when drawing rectangles.