Added separate onPaint event.