Added deprecation warning for Canvas.on_paint