aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-08-28 16:25:22 +0200
committerTectu <joel@unormal.org>2012-08-28 16:25:22 +0200
commitd71a6217907564388f36b0e99e6f6b9163a4cb83 (patch)
treec7d2cb248ee166c401277fd817d7695dab0d3d5c
parent2c7cbc1dd733d6835da7b49019e512d6eb06f8fa (diff)
downloaduGFX-d71a6217907564388f36b0e99e6f6b9163a4cb83.tar.gz
uGFX-d71a6217907564388f36b0e99e6f6b9163a4cb83.tar.bz2
uGFX-d71a6217907564388f36b0e99e6f6b9163a4cb83.zip
cleanup
-rw-r--r--src/gdisp.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/src/gdisp.c b/src/gdisp.c
index 2b8989e6..582d3377 100644
--- a/src/gdisp.c
+++ b/src/gdisp.c
@@ -660,8 +660,7 @@ void gdispDrawBox(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
}
void _draw_arc(int x, int y, int start, int end, int radius, color_t color) {
- if (start >= 0 && start <= 180)
- {
+ if (start >= 0 && start <= 180) {
float x_maxI = x + radius*cos(start*M_PI/180);
float x_minI;
@@ -674,8 +673,7 @@ void _draw_arc(int x, int y, int start, int end, int radius, color_t color) {
int b = radius;
int P = 1 - radius;
- do
- {
+ do {
if(x-a <= x_maxI && x-a >= x_minI)
gdispDrawPixel(x-a, y+b, color);
if(x+a <= x_maxI && x+a >= x_minI)
@@ -685,21 +683,18 @@ void _draw_arc(int x, int y, int start, int end, int radius, color_t color) {
if(x+b <= x_maxI && x+b >= x_minI)
gdispDrawPixel(x+b, y+a, color);
- if (P < 0)
- {
+ if (P < 0) {
P = P + 3 + 2*a;
a = a + 1;
- }else
- {
+ } else {
P = P + 5 + 2*(a - b);
a = a + 1;
b = b - 1;
}
- }while(a <= b);
+ } while(a <= b);
}
- if (end > 180 && end <= 360)
- {
+ if (end > 180 && end <= 360) {
float x_maxII = x+radius*cos(end*M_PI/180);
float x_minII;
@@ -712,7 +707,7 @@ void _draw_arc(int x, int y, int start, int end, int radius, color_t color) {
int b = radius;
int P = 1 - radius;
- do{
+ do {
if(x-a <= x_maxII && x-a >= x_minII)
gdispDrawPixel(x-a, y-b, color);
if(x+a <= x_maxII && x+a >= x_minII)
@@ -722,18 +717,15 @@ void _draw_arc(int x, int y, int start, int end, int radius, color_t color) {
if(x+b <= x_maxII && x+b >= x_minII)
gdispDrawPixel(x+b, y-a, color);
- if (P < 0)
- {
+ if (P < 0) {
P = P + 3 + 2*a;
a = a + 1;
- }
- else
- {
+ } else {
P = P + 5 + 2*(a - b);
a = a + 1;
b = b - 1;
}
- }while (a <= b);
+ } while (a <= b);
}
}
@@ -750,12 +742,12 @@ void _draw_arc(int x, int y, int start, int end, int radius, color_t color) {
* @api
*/
void gdispDrawArc(coord_t x, coord_t y, coord_t radius, uint16_t start, uint16_t end, color_t color) {
- if (end < start) {
+ if(end < start) {
_draw_arc(x, y, start, 360, radius, color);
_draw_arc(x, y, 0, end, radius, color);
- }
- else
+ } else {
_draw_arc(x, y, start, end, radius, color);
+ }
}
/*