qvec: fix undefined behaviour in PolyCentroid
This commit is contained in:
parent
fe99d69d07
commit
a60581c99a
|
|
@ -423,7 +423,7 @@ template<typename Iter, typename T = typename std::iterator_traits<Iter>::value_
|
||||||
else if (num_points == 1)
|
else if (num_points == 1)
|
||||||
return *begin;
|
return *begin;
|
||||||
else if (num_points == 2)
|
else if (num_points == 2)
|
||||||
return avg(*begin, *(++begin));
|
return avg(*begin, *(begin + 1));
|
||||||
|
|
||||||
T poly_centroid{};
|
T poly_centroid{};
|
||||||
value_type poly_area = 0;
|
value_type poly_area = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue