Skip to content

Commit

Permalink
Merge pull request #685 from ZeLonewolf/clay-draw-pentagon-bugfix
Browse files Browse the repository at this point in the history
Make pentagon shields symmetrical
  • Loading branch information
claysmalley authored Jan 13, 2023
2 parents ac60e07 + 495b025 commit 67c3e17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/shield_canvas_draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,10 @@ export function pentagon(
let halfComplementAngle2 = (Math.PI / 2 - angle) / 2;
let halfComplementTangent2 = Math.tan(halfComplementAngle2);

let x1 = x0 + angleSign * drawRadius1 * halfComplementTangent1 * sine;
let x1 = x0 + drawRadius1 * halfComplementTangent1 * sine;
let x3 = x2 + drawRadius2 * halfComplementTangent2;
let x5 = x6 - drawRadius2 * halfComplementTangent2;
let x7 = x8 - angleSign * drawRadius1 * halfComplementTangent1 * sine;
let x7 = x8 - drawRadius1 * halfComplementTangent1 * sine;
let y1 = y2 - angleSign * drawRadius1 * halfComplementTangent1 * cosine;

ctx.beginPath();
Expand Down

0 comments on commit 67c3e17

Please sign in to comment.