Skip to content

Polygon code fails when using on MatrixPortal M4 #26

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

Closed
DeanDavis opened this issue Nov 3, 2020 · 1 comment · Fixed by #27
Closed

Polygon code fails when using on MatrixPortal M4 #26

DeanDavis opened this issue Nov 3, 2020 · 1 comment · Fixed by #27

Comments

@DeanDavis
Copy link

Started to use this library on a 32x64 LED Matrix using the MatrixPortal M4
A simple line fails to render properly.

Example:
Group.append(adafruit_display_shapes.line(0,0,2,2,0xFFFFFF))

I would expect pixels (0,0), (1,1) & (2,2) to be white.
But only pixels (0,0) and (1,1) are lit.

In general one would always expect the beginning and ending pixels to be lit up every-time but this doesn't happen.

My cursory look at the code I think the bug appears in the polygon code.

The loop for x in range(x0, x1): where it attempts to color the bit map, range() doesn't include x1 in the range and x1 is the max value of all the x's passed into the polygon function.
So in my example x0=0, x2=2 so the x in the for loop never becomes 2 so pixel (2,2) will not become lit.

@makermelissa
Copy link
Collaborator

Ah yeah, I probably missed that when I was fixing a similar issue in #23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants