Skip to content

Commit

Permalink
Pointy line join fix
Browse files Browse the repository at this point in the history
(cherry picked from commit c1e3b23)
  • Loading branch information
Anuken authored and buthed010203 committed Oct 14, 2024
1 parent d6ce873 commit 4309778
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arc-core/src/arc/graphics/g2d/Lines.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ private static void preparePointyJoin(Vec2 A, Vec2 B, Vec2 C, Vec2 D, Vec2 E, fl
prepareStraightJoin(B, D, E, halfLineWidth);
return;
}
float len = (float)(halfLineWidth / Math.sin(angle));
//clamps length to avoid super sharp edges. this looks pretty bad, but it's better than the alternative of a 1-pixel line to infinity
float len = Mathf.clamp((float)(halfLineWidth / Math.sin(angle)), -halfLineWidth*10f, halfLineWidth*10f);
boolean bendsLeft = angle < 0;
AB.setLength(len);
BC.setLength(len);
Expand Down

0 comments on commit 4309778

Please sign in to comment.