Added fast implementation of a painting component and fixed some bugs with the rectangle selector.