Use parent offset to calcualte the line number