28084 ePaper draw rectangle Anomalies

1) Given that the display is 296 x 128 pixels you would expect (0,0,127,127) would be produce a square with a maximum height, however, it doesn't, (0,0,128,128) does.
2) In the included code I've rotated the display into landscape mode, however, (0,0,296,128) does not produce the expected result. Any width above 128, results in a vertical line at 128 while the top and bottom horizontal lines continue out to 296.

Looks like the driver needs to be tweaked a little.

I get the same results in Blocky or SimpleIDE.
908 x 498 - 49K


  • Ok, I think I found a solution to problem (2). The following is from the drawRect.c file:

    // Draw a rectangle
    void drawRect(screen_t *dev, int x, int y, int w, int h, int color) {
    drawFastHLine(dev, x + 1, y, w - 2, color);
    drawFastHLine(dev, x + 1, y + h - 1, w - 2, color);
    drawFastVLine(dev, x, y, h, color);
    drawFastVLine(dev, x + h - 1, y, h, color);

    In the last drawFastVLine call, x + h - 1, should be x + w -1.

    How do I get this to Matthew Matz?
Sign In or Register to comment.