Skip to content

PicoGraphics::line is offset by 1px #1108

@di-cl

Description

@di-cl

PicoGraphics::line implementation produces inconsistent result. I couldn't find a documentation for that but the assumption is that it is expected to draw a line from P1 to P2 including 2 points. The implementation assumes that the last point is not included, however even with this assumption the drawing logic does not take into account the direction of the line, therefore produces inconsistent result.
The attached below is produced by the following:
Point p1 {140, 100};
Point p2 {145, 100};
Point p3 {145, 105};
Point p4 {140, 105};
graphics.line(p1, p2);
graphics.line(p2, p3);
graphics.line(p3, p4);
graphics.line(p4, p1);

Image

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