Skip to content

Commit

Permalink
Fix setStencilImage not able to set stencil to nil, give default valu…
Browse files Browse the repository at this point in the history
…e to tile argument
  • Loading branch information
samdze committed Oct 12, 2024
1 parent 1a752d3 commit bf4f9c3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/playdate/graphics.nim
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,12 @@ proc set*(this: var LCDBitmap, x, y: int, color: LCDSolidColor = kColorBlack) =
var data = this.getData
data.set(x, y, color)

proc setStencilImage*(this: ptr PlaydateGraphics, bitmap: LCDBitmap, tile: bool) =
proc setStencilImage*(this: ptr PlaydateGraphics, bitmap: LCDBitmap, tile: bool = false) =
privateAccess(PlaydateGraphics)
this.setStencilImage(bitmap.resource, if tile: 1 else: 0)
if bitmap == nil:
this.setStencilImage(nil, if tile: 1 else: 0)
else:
this.setStencilImage(bitmap.resource, if tile: 1 else: 0)

proc makeFont*(this: LCDFontData, wide: bool): LCDFont =
privateAccess(PlaydateGraphics)
Expand Down

0 comments on commit bf4f9c3

Please sign in to comment.