Prevent painting break event