Skip to content
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

fix OnDiskBitmap pixel_shader #41

Merged
merged 3 commits into from
Jul 12, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
add todo comment about changing pixel_shader when support for CP6 is …
…dropped
  • Loading branch information
FoamyGuy committed Jul 10, 2021
commit 460e5fc89d34e7de663c49dcc8596681fb185741
5 changes: 4 additions & 1 deletion adafruit_displayio_layout/widgets/icon_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ def __init__(self, label_text, icon, on_disk=False, **kwargs):
self._file = open(self._icon, "rb")
image = OnDiskBitmap(self._file)
tile_grid = TileGrid(
image, pixel_shader=getattr(image, "pixel_shader", ColorConverter())
image,
pixel_shader=getattr(image, "pixel_shader", ColorConverter())
# TODO: Once CP6 is no longer supported replace the above line with below.
# tile_grid = TileGrid(image, pixel_shader=image.pixel_shader)
)
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding the following comment after the tile_grid = ... line

            # TODO: Once CP6 is no longer supported replace the above line with below.
            # tile_grid = TileGrid(image, pixel_shader=image.pixel_shader)

image, palette = adafruit_imageload.load(icon)
Expand Down