Fix incorrect exception catch
Do not paint children while Graph painter open
Separate out margins calculation from drawing.