更新SANT的摄像头,支持usb获取,修复文本清屏刷新问题

This commit is contained in:
dahanzimin
2025-06-17 19:59:18 +08:00
parent 05913fb01a
commit 5ded40ed21
3 changed files with 27 additions and 6 deletions

View File

@@ -417,7 +417,6 @@ class FrameBuffer_Uincode(FrameBuffer_Base):
if sync: self.fill(bg_color, sync=False)
self.set_buffer(data, sync)
else:
yy = y
if size is None:
font_len, font_buffer = self._take_buffer(str(data), space, 1)
size = min((self.width // font_len) if font_len > 0 else 1, self.height // self._font.height)
@@ -425,11 +424,7 @@ class FrameBuffer_Uincode(FrameBuffer_Base):
font_len, font_buffer = self._take_buffer(str(data), space, size)
x = (self.width - font_len + space) // 2 if center else x
y = (self.height - self._font.height * size) // 2 if y is None else y
if sync:
if yy is None:
self.fill(bg_color, sync=False)
else:
self.fill_rect(x - 1, y - 1, font_len + 2, font_buffer[0][1][1] * size + 2, bg_color, sync=False)
if sync: self.fill(bg_color, sync=False)
for buffer in font_buffer: #Display character
self.bitmap(buffer, x, y, size, bold, color)
x = buffer[1][0] * size + x + space