Skip to content

Commit 03ee2e1

Browse files
committed
Update docs
1 parent 90e9f22 commit 03ee2e1

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Sources/PlaydateKit/Core/Sprite.swift

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,8 @@ public enum Sprite {
8181
// MARK: Public
8282

8383
/// The sprite's stencil bitmap, if set.
84-
85-
86-
// I don't know why previous public private(set) var stencil
87-
// was causing this kind of error https://github.com/finnvoor/PlaydateKit/issues/51
88-
// Separating the public getter from ste private storage, resolved the issue
89-
private var _stencil: Graphics.Bitmap?
9084
public var stencil: Graphics.Bitmap? { _stencil }
91-
85+
9286
/// The bitmap currently assigned to the sprite.
9387
public var image: Graphics.Bitmap? {
9488
didSet {
@@ -209,7 +203,7 @@ public enum Sprite {
209203
/// Specifies a stencil image to be set on the frame buffer before the sprite is drawn.
210204
/// Pass `nil` to clear the sprite’s stencil.
211205
public func setStencil(_ stencil: Graphics.Bitmap?) {
212-
self._stencil = stencil
206+
_stencil = stencil
213207
if let stencil {
214208
sprite.setStencil.unsafelyUnwrapped(pointer, stencil.pointer)
215209
} else {
@@ -220,7 +214,7 @@ public enum Sprite {
220214
/// Specifies a stencil image to be set on the frame buffer before the sprite is drawn. If `tile` is set, the stencil will be tiled.
221215
/// Tiled stencils must have width evenly divisible by 32.
222216
public func setStencilImage(_ stencil: Graphics.Bitmap, tile: CInt) {
223-
self._stencil = stencil
217+
_stencil = stencil
224218
sprite.setStencilImage.unsafelyUnwrapped(pointer, stencil.pointer, tile)
225219
}
226220

@@ -345,6 +339,13 @@ public enum Sprite {
345339
) {
346340
sprite.setUpdateFunction.unsafelyUnwrapped(pointer, updateFunction)
347341
}
342+
343+
// MARK: Private
344+
345+
/// I don't know why previous public private(set) var stencil
346+
/// was causing this kind of error https://github.com/finnvoor/PlaydateKit/issues/51
347+
/// Separating the public getter from ste private storage, resolved the issue
348+
private var _stencil: Graphics.Bitmap?
348349
}
349350

350351
// MARK: Public

0 commit comments

Comments
 (0)