fix fill angle outside -90 | 90

This commit is contained in:
Stewart Allen 2021-07-12 10:34:01 -04:00
commit a4a3077821
3 changed files with 8 additions and 7 deletions

View file

@ -655,6 +655,7 @@
// ensure angle is in the -90:90 range // ensure angle is in the -90:90 range
angle = angle % 180; angle = angle % 180;
while (angle < -90) angle += 180;
while (angle > 90) angle -= 180; while (angle > 90) angle -= 180;
// X,Y ray slope derived from angle // X,Y ray slope derived from angle

View file

@ -161,10 +161,10 @@ if (!self.window) (function() {
debug_string: (len, ptr) => { console.log('wasm', readString(ptr, len)) } debug_string: (len, ptr) => { console.log('wasm', readString(ptr, len)) }
}, },
wasi_snapshot_preview1: { wasi_snapshot_preview1: {
args_get: (count,bufsize) => { return 0 }, // args_get: (count,bufsize) => { return 0 },
args_sizes_get: (count,bufsize) => { }, // args_sizes_get: (count,bufsize) => { },
environ_get: (count,bufsize) => { return 0 }, // environ_get: (count,bufsize) => { return 0 },
environ_sizes_get: (count,bufsize) => { }, // environ_sizes_get: (count,bufsize) => { },
proc_exit: (code) => { return code } proc_exit: (code) => { return code }
} }
})) }))

View file

@ -1172,14 +1172,14 @@
} }
if (tofill.length > 0) { if (tofill.length > 0) {
doFillArea(fillQ, tofill, angle, spacing, newfill); doFillArea(fillQ, tofill, angle, spacing, newfill);
top.fill_lines_norm = {angle:angle,spacing:spacing}; // top.fill_lines_norm = {angle:angle,spacing:spacing};
} }
if (angfill.length > 0) { if (angfill.length > 0) {
top.fill_lines_ang = {spacing:spacing,list:[],poly:[]}; top.fill_lines_ang = {spacing:spacing,list:[],poly:[]};
for (let af of angfill) { for (let af of angfill) {
doFillArea(fillQ, [af], af.fillang.angle + 45, spacing, newfill); doFillArea(fillQ, [af], af.fillang.angle + 45, spacing, newfill);
top.fill_lines_ang.list.push(af.fillang.angle + 45); // top.fill_lines_ang.list.push(af.fillang.angle + 45);
top.fill_lines_ang.poly.push(af.clone()); // top.fill_lines_ang.poly.push(af.clone());
} }
} }
} }