When on-paint is overridden, call this method when the state of on-paint's drawing changes.
The x, y, width, and height arguments specify the area that needs repainting in buffer coordinates. If width/height is -1, then the total heigh/width of the buffer is used.