Skip to content

Commit 90dea13

Browse files
committed
refactor(RaspberryPi): refactor FrameBuffer.drawChar
1 parent f7ed9a1 commit 90dea13

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Sources/RaspberryPi/Framebuffer.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,10 @@ package struct Framebuffer<Depth: UnsignedInteger>: ~Copyable {
128128

129129
package mutating func drawChar(_ c: UInt8, x: Int, y: Int, color: Depth) {
130130
guard c < font.count else { return }
131+
let glyph = font[Int(c)]
131132
for i in 0..<fontHeight {
132-
for j in 0..<fontWidth {
133-
if font[Int(c)][i] & 1 << j != 0 {
134-
self.drawPoint(x: x &+ j, y: y &+ i, color: color)
135-
}
133+
for j in 0..<fontWidth where glyph[i] & 1 << j != 0 {
134+
self.drawPoint(x: x &+ j, y: y &+ i, color: color)
136135
}
137136
}
138137
}

0 commit comments

Comments
 (0)