Horizontal offset calculation