Closed patfelst closed 4 years ago
Hi, Thanks for reporting this. It is indeed a bug.
I have updated the code but am unable to test it today due to other commitments. Can you download the updated Sprite.cpp file (or complete library from Github) and test please.
I've just tested it thoroughly, it's fixed now. Thanks for doing so quickly!
I just realised I only tested .fillRoundRect, I won't be able to test .fillRect for a couple of days. Unless it's the same / inherited code.
fillRoundRect uses fillRect so the problem would have shown up. Thanks.
Hi there, I'm using a ST7735 160x80 pixels with an ESP32 with PSRAM (TinyPico). I'm using a sprite to prevent flickering on a rectangular bargraph. The bargraph has a "zero" point at 40 pixels from the left. Positive data makes the bargraph increase to the right, negative data values make it "increase" to the left from the "zero" point.
I'm getting what looks like a bug for the negative data values, I think it's because the starting x-coord of the rectangle changes almost every new data value (sample), whereas the positive samples always start at x=40.
I've narrowed the "bug" down so that if the starting x-coord of the rectangle is even, the rectangle draws ok. If I change the x-coord by even 1-pixel, or basically x-coord is any odd value, then the rectangle is drawn broken. It draws an unfilled rectangle at what appearas to be the correct position, but the filled in part is off to the right. It is independent of the width of the rectangle. It happens whether I use a fillRoundRect or fillRect. Unfilled rectangles (drawRect) are ok. If I don't use sprites, it works ok.
Hoping you can help please, and thanks so much for this library!
I've hard coded the coordinates and width for the purposes of this issue. Also attached some photos:
Both rectangles ok with even x-coords:
Filled rectangle x-coord changed by 1-pixel (23), odd number, broken:
Close up of the above case:
And finally, the unfilled yellow rectangle, change x-coord from 110 to 111: