Skip to content

Commit 853599b

Browse files
author
funnygeeker
committed
update
1 parent 05ffe7f commit 853599b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

libs/easydisplay.mpy

12 Bytes
Binary file not shown.

libs/easydisplay.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def text(self, s: str, x: int, y: int,
377377
FrameBuffer(data, font_size, font_size,
378378
RGB565), x, y, key)
379379
else:
380-
dp.set_window(x, y, x + font_size - 1, y + font_size)
380+
dp.set_window(x, y, x + font_size - 1, y + font_size - 1)
381381
dp.write_data(data)
382382
else:
383383
data = self._RGB565_font_size(byte_data, font_size, palette, self._size)
@@ -386,7 +386,7 @@ def text(self, s: str, x: int, y: int,
386386
FrameBuffer(data,
387387
font_size, font_size, RGB565), x, y, key)
388388
else:
389-
dp.set_window(x, y, x + font_size - 1, y + font_size)
389+
dp.set_window(x, y, x + font_size - 1, y + font_size - 1)
390390
dp.write_data(data)
391391
# 英文字符半格显示
392392
if ord(char) < 128 and half_char:
@@ -450,7 +450,7 @@ def pbm(self, file: str, x, y, key: int = -1, show: bool = None, clear: bool = N
450450
if reversion: # New
451451
color, bg_color = bg_color, color
452452
palette = self._calculate_palette(color, bg_color) # 计算调色板
453-
dp.set_window(x, y, x + _width - 1, y + _height) # 设置窗口
453+
dp.set_window(x, y, x + _width - 1, y + _height - 1) # 设置窗口
454454
data = f_read(buffer_size)
455455
write_data = dp.write_data
456456
while data:
@@ -522,7 +522,7 @@ def pbm(self, file: str, x, y, key: int = -1, show: bool = None, clear: bool = N
522522
except AttributeError:
523523
pass
524524
else: # 直接驱动
525-
dp.set_window(x, y, x + _width - 1, y + _height) # 设置窗口
525+
dp.set_window(x, y, x + _width - 1, y + _height - 1) # 设置窗口
526526
buffer = bytearray(_width * 2)
527527
for _y in r_height: # 逐行显示图片
528528
for _x in r_width:
@@ -622,7 +622,7 @@ def bmp(self, file: str, x, y, key: int = -1, show: bool = None, clear: bool = N
622622
buffer = bytearray(_width * 2)
623623
self_buf = self._buffer
624624
if not self_buf:
625-
dp.set_window(x, y, x + _width - 1, y + _height) # 设置窗口
625+
dp.set_window(x, y, x + _width - 1, y + _height - 1) # 设置窗口
626626
r_width = range(_width)
627627
r_height = range(_height)
628628
for _y in r_height:
@@ -716,7 +716,7 @@ def dat(self, file, x, y, key=-1):
716716
size = self.BUFFER_SIZE * 10
717717
data = f_read(size)
718718
dp_write = self.display.write_data
719-
self.display.set_window(x, y, x + _width - 1, y + _height)
719+
self.display.set_window(x, y, x + _width - 1, y + _height - 1)
720720
while data:
721721
dp_write(data)
722722
data = f_read(size)

0 commit comments

Comments
 (0)