updated insert_point code
support CGRect in calculate handler