Skip to content

Commit

Permalink
Bug fix (#15)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
abetusk authored Sep 23, 2024
1 parent a293ab7 commit f6d7a06
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ports/gilbert.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,11 +585,11 @@ function gilbert_d2xyz_r(dst_idx, cur_idx, p, a, b, c) {

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

module.exports["d2xy"] = gilbert_xy2d;
module.exports["xy2d"] = gilbert_d2xy;
module.exports["d2xy"] = gilbert_d2xy;
module.exports["xy2d"] = gilbert_xy2d;

module.exports["d2xyz"] = gilbert_xyz2d;
module.exports["xyz2d"] = gilbert_d2xyz;
module.exports["d2xyz"] = gilbert_d2xyz;
module.exports["xyz2d"] = gilbert_xyz2d;

module.exports["main"] = _main;

Expand Down

0 comments on commit f6d7a06

Please sign in to comment.