** Function name: fillRoundRect ** Description: Draw a rounded corner filled rectangle ***************************************************************************************/ Fill a rounded rectangle, changed to horizontal lines (faster in sprites)
| 2663 | ***************************************************************************************/ |
| 2664 | // Fill a rounded rectangle, changed to horizontal lines (faster in sprites) |
| 2665 | void TFT_eSPI::fillRoundRect(int32_t x, int32_t y, int32_t w, int32_t h, int32_t r, uint32_t color) |
| 2666 | { |
| 2667 | //begin_tft_write(); // Sprite class can use this function, avoiding begin_tft_write() |
| 2668 | inTransaction = true; |
| 2669 | |
| 2670 | // smarter version |
| 2671 | fillRect(x, y + r, w, h - r - r, color); |
| 2672 | |
| 2673 | // draw four corners |
| 2674 | fillCircleHelper(x + r, y + h - r - 1, r, 1, w - r - r - 1, color); |
| 2675 | fillCircleHelper(x + r , y + r, r, 2, w - r - r - 1, color); |
| 2676 | |
| 2677 | inTransaction = lockTransaction; |
| 2678 | end_tft_write(); // Does nothing if Sprite class uses this function |
| 2679 | } |
| 2680 | |
| 2681 | |
| 2682 | /*************************************************************************************** |