mapbox / polylabel

A fast algorithm for finding the pole of inaccessibility of a polygon (in JavaScript and C++)
Other
1.44k stars 151 forks source link

Format debug distance as float instead of integer. #64

Closed Kalabasa closed 4 years ago

Kalabasa commented 4 years ago
console.log('found best %d after %d probes', Math.round(1e4 * cell.d) / 1e4, numProbes);

This prints cell.d as %d which is an integer. It will print values lower than 1 as just 0.

Fix: Use %f to print decimal.