Skip to content

Commit ec99845

Browse files
committed
#2 parity with js: mapbox/delaunator@d7a7ce6
1 parent e458e1b commit ec99845

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/delaunator.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,8 @@ std::size_t Delaunator::hash_key(double x, double y) {
557557
const double dx = x - m_center_x;
558558
const double dy = y - m_center_y;
559559
return static_cast<std::size_t>(std::llround(
560-
std::floor(pseudo_angle(dx, dy) * static_cast<double>(m_hash_size))));
560+
std::floor(pseudo_angle(dx, dy) * static_cast<double>(m_hash_size)))) %
561+
m_hash_size;
561562
}
562563

563564
void Delaunator::hash_edge(std::size_t e) {

0 commit comments

Comments
 (0)