Skip to content

Incorrect parameter names and docstrings #15

@hex-yes

Description

@hex-yes

First, the RA8875 driver board and library helped me complete my project, and I sincerely appreciate the effort that went into both.

I discovered that the parameter names for the _rect_helper method of the RA8875 class are inconsistent with the actual drawing behavior. The method signature is:

_rect_helper(self, x, y, width, height, color, filled)

However, the width and height parameters should really be the x- and y-coordinate of the endpoint--they are a second absolute x-y screen coordinate, rather than a width and height offset applied to the first screen coordinate. Page 120 of the RA8875 datasheet that is linked from the Adafruit product page confirms the registers written by this method are an endpoint coordinate, not width/height.

This parameter mislabeling carries through to the public methods of the same class that rely on the _rect_helper method, including at least the rect and fill_rect methods (but possibly others...these are just the ones I happened to use with confusing results).

I would suggest that the signature of the _rect_helper method be changed to be consistent with other methods like _triangle_helper:

_rect_helper(self, x1, y1, x2, y2, color, filled)

I would then suggest that the parameters and documentation for other methods like rect and fill_rect that currently specify a width/height be updated accordingly. By changing the parameter names and documentation, existing code (including the examples) that relies on the existing behavior will not be broken.

Metadata

Metadata

Assignees

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