improved shape brush state handling