Added support for cancelling whole polylines and closing shapes