PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Display
libsimplegfx
fillRoundRect.c
1
/*
2
* @file fillRoundRect.c
3
*
4
* @author Matthew Matz
5
*
6
* @version 0.5
7
*
8
* @copyright Copyright (C) Parallax, Inc. 2019. See end of file for
9
* terms of use (MIT License).
10
*
11
* @brief This is a driver that allows the Propeller Multicore Microcontroller to
12
* draw text, shapes, and bitmap files on various screens and displays.
13
*
14
* @detail This helper-library allows the Propeller Multicore Microcontroller to
15
* draw pixels, lines, circles, recatngles, rounded rectagles, triangles, formatted text
16
* in multiple fonts, bitmap images stored on an SD card on various screens and displays.
17
* At Parallax, we would like to thank Adafruit Industries as parts of this library
18
* were dervied from the Adafruit GFX library for Arduino. Please submit bug reports,
19
* suggestions, and improvements to this code to editor@parallax.com.
20
*
21
* @note If fonts are installed, they occupy EEPROM addresses 40576 to 63359.
22
*/
23
24
25
#include "simplegfx.h"
26
27
// Draw a filled rounded rectangle
28
void
fillRoundRect(
screen_t
* dev,
int
x
,
int
y,
int
w,
int
h,
int
r,
int
color) {
29
int
sMin = w;
30
if
(h < w) sMin = h;
31
if
(r >= (sMin >> 1)) r = (sMin >> 1) - 1;
32
33
// smarter version
34
fillRect(dev,
x
+ r, y, w - (r << 1), h, color);
35
36
// draw four corners
37
fillCircleHelper(dev,
x
- r + w - 1, y + r, r, 1, h - (r << 1) - 1, color);
38
fillCircleHelper(dev,
x
+ r, y + r, r, 2, h - (r << 1) - 1, color);
39
}
40
41
x
int x
Definition:
07 Box and Lines.c:13
screen_st
Definition:
simplegfx.h:111
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17