example of accessing state from onDraw()