Skip to content

Commit

Permalink
Change fillPolygon to openArray
Browse files Browse the repository at this point in the history
This allows fillPolygon to be used with seqs and arrays, which have much better performance
  • Loading branch information
ninovanhooff authored Sep 28, 2024
1 parent 13a06b2 commit a5f8a98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/playdate/graphics.nim
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ proc createPattern*(this: ptr PlaydateGraphics, bitmap: LCDBitmap, x: int, y: in

import macros

proc fillPolygon*[Int32x2](this: ptr PlaydateGraphics, points: seq[Int32x2], color: LCDColor, fillRule: LCDPolygonFillRule) =
proc fillPolygon*[Int32x2](this: ptr PlaydateGraphics, points: openArray[Int32x2], color: LCDColor, fillRule: LCDPolygonFillRule) =
when sizeof(Int32x2) != sizeof(int32) * 2: {.error: "size of points is not sizeof(int32) * 2".}

privateAccess(PlaydateGraphics)
Expand Down

0 comments on commit a5f8a98

Please sign in to comment.