Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions js/turtle-painter.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ class Painter {
let sa = oAngleRadians - Math.PI;
let ea = oAngleRadians;

const steps = Math.max(Math.floor(savedStroke, 1));
const steps = Math.max(Math.floor(savedStroke), 1);
this._svgArc(steps, cx, cy, step, sa, ea, false, true);

this.turtle.ctx.lineTo(ox + dx, oy + dy);
Expand All @@ -364,7 +364,7 @@ class Painter {
sa = oAngleRadians - Math.PI;
ea = oAngleRadians;

const stepsFinal = Math.max(Math.floor(savedStroke, 1));
const stepsFinal = Math.max(Math.floor(savedStroke), 1);
this._svgArc(stepsFinal, cx, cy, step, sa, ea, false, true);

this.closeSVG();
Expand Down Expand Up @@ -604,7 +604,7 @@ class Painter {
diff -= 2 * Math.PI;
}
const nsteps = Math.max(Math.floor((radius * Math.abs(diff)) / 2), 2);
const steps = Math.max(Math.floor(savedStroke, 1));
const steps = Math.max(Math.floor(savedStroke), 1);

this._svgArc(nsteps, cx, cy, radius + step, sa, ea, anticlockwise, true);

Expand Down Expand Up @@ -1038,7 +1038,7 @@ class Painter {
this.turtle.ctx.lineCap = "round";

const step = savedStroke < 3 ? 0.5 : (savedStroke - 2) / 2;
const steps = Math.max(Math.floor(savedStroke, 1));
const steps = Math.max(Math.floor(savedStroke), 1);

let degreesInitial = Math.atan2(cp1x - this.turtle.x, cp1y - this.turtle.y);
degreesInitial = (180 * degreesInitial) / Math.PI;
Expand Down
Loading