check if text or box before getting line start pos