Fix fillRoundRect

This commit is contained in:
Laurence Bank
2024-11-23 18:46:01 +00:00
parent c66913c56c
commit 1e67829ede
2 changed files with 7 additions and 4 deletions
@@ -311,12 +311,16 @@ void FunctionTest(void)
epd.setFont(FONT_16x16);
epd.println("16x16 font");
epd.fillCircle(26, 80, 25, BBEP_BLACK);
epd.fillRect(60, 60, 40, 40, BBEP_RED);
epd.drawRect(60, 60, 40, 40, BBEP_RED);
epd.drawCircle(26, 134, 25, BBEP_RED);
epd.fillRoundRect(60, 114, 40, 40, 8, BBEP_BLACK);
epd.writePlane();
epd.refresh(REFRESH_FULL, true); // display the white buffer and return
epd.sleep(LIGHT_SLEEP);
delay(5000);
} // for iRot
oled.setCursor(0,24);
oled.print("Clear ");
epd.fillScreen(BBEP_WHITE);
epd.writePlane();
epd.refresh(REFRESH_FULL, true);
+2 -3
View File
@@ -1703,9 +1703,8 @@ void bbepRectangle(BBEPDISP *pBBEP, int x1, int y1, int x2, int y2, uint8_t ucCo
void bbepRoundRect(BBEPDISP *pBBEP, int x, int y, int w, int h, int r, uint8_t iColor, int bFilled)
{
if (bFilled) {
bbepRectangle(pBBEP, x+r, y, w-(2*r), r, iColor, 1);
bbepRectangle(pBBEP, x, y+r, w, h-(2*r), iColor, 1);
bbepRectangle(pBBEP, x+r, y+h-r, w-(2*r), r, iColor, 1);
bbepRectangle(pBBEP, x+r, y, x+w-1-r, y+h, iColor, 1);
bbepRectangle(pBBEP, x, y+r, x+w-1, y+h-r, iColor, 1);
// draw four corners
bbepEllipse(pBBEP, x+w-r-1, y+r, r, r, 1, iColor, 1);
bbepEllipse(pBBEP, x+r, y+r, r, r, 2, iColor, 1);