update drawing logic