Fix offset calculation for line legend icons (#2636)