Added convenience overloads to Rect and also, Collection conformance in the Playdate bindings target.

This commit is contained in:
2026-07-26 00:31:58 +02:00
parent 41558399e3
commit 0d0b397ce1
5 changed files with 92 additions and 0 deletions
@@ -56,3 +56,17 @@ extension Graphics {
public var count: Int { info.count }
}
}
extension Graphics.BitmapTable: RandomAccessCollection {
public var startIndex: Int { 0 }
public var endIndex: Int { count }
/// The bitmap at `position`. The bitmap references storage owned by the
/// table; keep the table alive while using it.
public subscript(position: Int) -> Graphics.Bitmap {
guard let bitmap = bitmap(at: position) else {
preconditionFailure("bitmap table index out of range")
}
return bitmap
}
}