Skip to content

Commit

Permalink
Fix Lines.polyline when only two points are provided
Browse files Browse the repository at this point in the history
  • Loading branch information
buthed010203 committed Jan 5, 2024
1 parent cfe25db commit a20760a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arc-core/src/arc/graphics/g2d/Lines.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ public static void polyline(FloatSeq points, boolean wrap){
//implementation taken from https://github.com/earlygrey/shapedrawer/blob/master/drawer/src/space/earlygrey/shapedrawer/ShapeDrawer.java
public static void polyline(float[] points, int length, boolean wrap){
if(length < 4) return;
if(length == 4){ //line is faster and this method doesn't even work correctly with 2 items
line(points[0], points[1], points[2], points[3]);
return;
}

float halfWidth = 0.5f * stroke;

Expand Down

0 comments on commit a20760a

Please sign in to comment.