From 7c0186bdc79e891fb636ab59cfbddea09fdef91d Mon Sep 17 00:00:00 2001 From: funnygeeker Date: Sat, 27 Apr 2024 12:19:23 +0800 Subject: [PATCH] Fix the bug that global default parameters cannot be inherited --- lib/easydisplay.mpy | Bin 5787 -> 5784 bytes lib/easydisplay.py | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/easydisplay.mpy b/lib/easydisplay.mpy index 055122e5e8a6fdf0dffa1ad170339deed81b3020..636f233bdbfbd5d6b55e4c91f53f2608165a5882 100644 GIT binary patch delta 74 zcmbQOJ41JaJS$Ug$z(-VRmQ@}?yU6&fpDP36>KajW@98K<^mK82n^I>3pN%Pb473@ N#C!rb|72Yx008<%6b1kQ delta 77 zcmbQCJ6m^yJS$Tl&tyebRmPIZ?yU93O3nZ48v>y~i!0bzRLsUmOw6S|Ffbr6P>U_t TSX|5%!I2R2so(sKb&&u7X~h;T diff --git a/lib/easydisplay.py b/lib/easydisplay.py index b96dc62..517407f 100644 --- a/lib/easydisplay.py +++ b/lib/easydisplay.py @@ -261,7 +261,7 @@ def load_font(self, file: str): self.font_bitmap_size = self.font_bmf_info[8] def text(self, s: str, x: int, y: int, - color: int = 0xFFFF, bg_color: int = 0, size: int = None, + color: int = None, bg_color: int = None, size: int = None, half_char: bool = None, auto_wrap: bool = None, show: bool = None, clear: bool = None, key: bool = None, invert: bool = None, line_spacing: int = None, *args, **kwargs): """ @@ -401,7 +401,7 @@ def text(self, s: str, x: int, y: int, def ppm(self, *args, **kwargs): self.pbm(*args, **kwargs) - def pbm(self, file, x, y, key: int = -1, show: bool = None, clear: bool = None, invert: bool = False, + def pbm(self, file, x, y, key: int = None, show: bool = None, clear: bool = None, invert: bool = False, color: int = None, bg_color: int = None): """ Display PBM / PPM Image @@ -578,7 +578,7 @@ def pbm(self, file, x, y, key: int = -1, show: bool = None, clear: bool = None, self.show() if show else 0 # 立即显示 - def bmp(self, file, x, y, key: int = -1, show: bool = None, clear: bool = None, invert: bool = False, + def bmp(self, file, x, y, key: int = None, show: bool = None, clear: bool = None, invert: bool = False, color: int = None, bg_color: int = None): """ Display BMP Image 显示 bmp 图片 @@ -722,7 +722,7 @@ def bmp(self, file, x, y, key: int = -1, show: bool = None, clear: bool = None, else: raise TypeError("Unsupported file type: only BMP images are supported.") - def dat(self, file, x, y, key=-1): + def dat(self, file, x, y, key=None): """ Display screen raw data file, with extremely high efficiency, only supports RGB565 format. 显示表示屏幕原始数据的文件,拥有极高的效率,仅支持 RGB565 格式