Skip to content

Replaced hard coded display widths and heights for Titano #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions adafruit_pyportal.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@ def __init__(self, *, url=None, headers=None, json_path=None, regexp_path=None,
if not self._image_position:
self._image_position = (0, 0) # default to top corner
if not self._image_resize:
self._image_resize = (320, 240) # default to full screen
self._image_resize = (board.DISPLAY.width,
board.DISPLAY.height) # default to full screen
if hasattr(board, 'TOUCH_XL'):
if self._debug:
print("Init touchscreen")
Expand All @@ -387,7 +388,8 @@ def __init__(self, *, url=None, headers=None, json_path=None, regexp_path=None,
board.TOUCH_YD, board.TOUCH_YU,
calibration=((5200, 59000),
(5800, 57000)),
size=(320, 240))
size=(board.DISPLAY.width,
board.DISPLAY.height))
# pylint: enable=no-member

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