Skip to content

Commit f6d7a06

Browse files
authored
Bug fix (#15)
* increase height of preview canvas image in demo * small sized curves get cutoff (e.g. 3x3) because the window scaling factor is only 1.1 and the margins are significant at small scales. Increasing the height factor to 2 (from 1.1) alleviates the problem while minimizing the risk of the canvas spilling over horizontally. * resolves #11 * vestigial test code that caused `gilbert_d2xy(&x, &y, 7861, 490, 490)` to incorrectly return -1 (there was a `max_iter` check to return after some hard coded value) * added test to make sure at least that condition is tested for * `gilbert.c` had buffer overrun setting last byte of `buf`, correctly sets `buf[1023]='\0'` instead of `buf[1024]` * bug fix * exported functions got switched (js), fixed
1 parent a293ab7 commit f6d7a06

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ports/gilbert.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -585,11 +585,11 @@ function gilbert_d2xyz_r(dst_idx, cur_idx, p, a, b, c) {
585585

586586
if (typeof module !== "undefined") {
587587

588-
module.exports["d2xy"] = gilbert_xy2d;
589-
module.exports["xy2d"] = gilbert_d2xy;
588+
module.exports["d2xy"] = gilbert_d2xy;
589+
module.exports["xy2d"] = gilbert_xy2d;
590590

591-
module.exports["d2xyz"] = gilbert_xyz2d;
592-
module.exports["xyz2d"] = gilbert_d2xyz;
591+
module.exports["d2xyz"] = gilbert_d2xyz;
592+
module.exports["xyz2d"] = gilbert_xyz2d;
593593

594594
module.exports["main"] = _main;
595595

0 commit comments

Comments
 (0)