Skip to content

Commit d9f7c12

Browse files
authored
Merge pull request #64 from cogliano/master
Replaced hard coded display widths and heights for Titano
2 parents c920305 + 0770e9c commit d9f7c12

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

adafruit_pyportal.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,8 @@ def __init__(self, *, url=None, headers=None, json_path=None, regexp_path=None,
378378
if not self._image_position:
379379
self._image_position = (0, 0) # default to top corner
380380
if not self._image_resize:
381-
self._image_resize = (320, 240) # default to full screen
381+
self._image_resize = (board.DISPLAY.width,
382+
board.DISPLAY.height) # default to full screen
382383
if hasattr(board, 'TOUCH_XL'):
383384
if self._debug:
384385
print("Init touchscreen")
@@ -387,7 +388,8 @@ def __init__(self, *, url=None, headers=None, json_path=None, regexp_path=None,
387388
board.TOUCH_YD, board.TOUCH_YU,
388389
calibration=((5200, 59000),
389390
(5800, 57000)),
390-
size=(320, 240))
391+
size=(board.DISPLAY.width,
392+
board.DISPLAY.height))
391393
# pylint: enable=no-member
392394

393395
self.set_backlight(1.0) # turn on backlight
@@ -439,7 +441,7 @@ def set_background(self, file_or_color, position=None):
439441
x=position[0], y=position[1])
440442
elif isinstance(file_or_color, int):
441443
# Make a background color fill
442-
color_bitmap = displayio.Bitmap(320, 240, 1)
444+
color_bitmap = displayio.Bitmap(board.DISPLAY.width, board.DISPLAY.height, 1)
443445
color_palette = displayio.Palette(1)
444446
color_palette[0] = file_or_color
445447
try:

0 commit comments

Comments
 (0)