aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-08-24 15:54:32 +0200
committerTectu <joel@unormal.org>2012-08-24 15:54:32 +0200
commit8fd1de6ef5a806ccc6e23ba1ba18dfc06b6fbbde (patch)
tree7d4bd73bf31072d822fff365f6c2cf840979ba9e /src
parent580c00b8f89ef775636f59e26a36aec7d44c7c5c (diff)
downloaduGFX-8fd1de6ef5a806ccc6e23ba1ba18dfc06b6fbbde.tar.gz
uGFX-8fd1de6ef5a806ccc6e23ba1ba18dfc06b6fbbde.tar.bz2
uGFX-8fd1de6ef5a806ccc6e23ba1ba18dfc06b6fbbde.zip
first try to implement gdispDrawARC() (not working yet)
Diffstat (limited to 'src')
-rw-r--r--src/gdisp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gdisp.c b/src/gdisp.c
index 6cf58561..f5da45b9 100644
--- a/src/gdisp.c
+++ b/src/gdisp.c
@@ -672,7 +672,13 @@ void gdispDrawBox(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
* @api
*/
void gdispDrawArc(coord_t x, coord_t y, coord_t radius, uint16_t start, uint16_t end, color_t color) {
+ uint16_t i;
+ float step = 0.01;
+ for(i = 0; i <= (int)((abs(end-start)) / step); i++) {
+ gdispDrawPixel( ((float)x + (float)radius * cosf((float)start * M_PI / 180.0f) + (float)i * step * M_PI / 180.0f),
+ ((float)y + (float)radius * sinf((float)start * M_PI / 180.0f) + (float)i * step * M_PI / 180.0f), color);
+ }
}
/*