Skip to content

Commit

Permalink
Pointy line join fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Oct 13, 2024
1 parent dd60085 commit c1e3b23
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 @@ -248,7 +248,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 c1e3b23

Please sign in to comment.