Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #32 from dunkmann00/revert-31-slice-fix
Browse files Browse the repository at this point in the history
Revert "Fix slice indices failure."
  • Loading branch information
kattni authored Jul 12, 2021
2 parents 088dbbf + 1f85b95 commit 4f005e5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions adafruit_pypixelbuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,7 @@ def _set_item(

def __setitem__(self, index, val):
if isinstance(index, slice):
start = index.start if index.start is not None else 0
stop = index.stop if index.stop is not None else len(self)
step = index.step if index.step is not None else 1
start, stop, step = index.indices(self._pixels)
for val_i, in_i in enumerate(range(start, stop, step)):
r, g, b, w = self._parse_color(val[val_i])
self._set_item(in_i, r, g, b, w)
Expand Down

0 comments on commit 4f005e5

Please sign in to comment.