Skip to content

Polygon code fails when using on MatrixPortal M4 #26

Closed
@DeanDavis

Description

@DeanDavis

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions