larsvers / d3-hexgrid

Regular hexagon tessellation with edge cover detection.
BSD 3-Clause "New" or "Revised" License
153 stars 17 forks source link

Force round width value #3

Closed larsvers closed 5 years ago

larsvers commented 5 years ago

An unrounded width value over here as in:

image[Math.floor(center[0]) + Math.floor(center[1]) * w]

can lead to non-detected indeces. Replace with:

image[Math.floor(center[0]) + Math.floor(center[1]) * Math.floor(w)]