examples/pwlines/pwlines_update.c: Appease nxstyle

This commit is contained in:
YAMAMOTO Takashi 2020-11-13 14:26:23 +09:00 committed by Xiang Xiao
parent df09b14f18
commit 2556c6f800

@ -123,32 +123,37 @@ void pwlines_circle(FAR struct pwlines_state_s *st)
} }
/* Back off the radius to account for the thickness of border line /* Back off the radius to account for the thickness of border line
* and with a big fudge factor that will (hopefully) prevent the corners * and with a big fudge factor that will (hopefully) prevent the
* of the lines from overwriting the border. This is overly complicated * corners of the lines from overwriting the border. This is overly
* here because we don't assume anything about the screen resolution or * complicated here because we don't assume anything about the screen
* the borderwidth or the line thickness (and there are certainly some * resolution or the borderwidth or the line thickness (and there are
* smarter ways to do this). * certainly some smarter ways to do this).
*/ */
if (maxradius > (CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 80)) if (maxradius > (CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 80))
{ {
wndo->radius = maxradius - (CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 40); wndo->radius = maxradius -
(CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 40);
} }
else if (maxradius > (CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 60)) else if (maxradius > (CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 60))
{ {
wndo->radius = maxradius - (CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 30); wndo->radius = maxradius -
(CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 30);
} }
else if (maxradius > (CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 40)) else if (maxradius > (CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 40))
{ {
wndo->radius = maxradius - (CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 20); wndo->radius = maxradius -
(CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 20);
} }
else if (maxradius > (CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 20)) else if (maxradius > (CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 20))
{ {
wndo->radius = maxradius - (CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 10); wndo->radius = maxradius -
(CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 10);
} }
else if (maxradius > (CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 10)) else if (maxradius > (CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 10))
{ {
wndo->radius = maxradius - (CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 5); wndo->radius = maxradius -
(CONFIG_EXAMPLES_PWLINES_BORDERWIDTH + 5);
} }
else else
{ {
@ -202,12 +207,15 @@ void pwlines_update(FAR struct pwlines_state_s *st)
vector.pt2.y = wndo->center.y - halfy; vector.pt2.y = wndo->center.y - halfy;
printf("Angle: %08x vector: (%d,%d)->(%d,%d)\n", printf("Angle: %08x vector: (%d,%d)->(%d,%d)\n",
wndo->angle, vector.pt1.x, vector.pt1.y, vector.pt2.x, vector.pt2.y); wndo->angle, vector.pt1.x, vector.pt1.y, vector.pt2.x,
vector.pt2.y);
/* Clear the previous line by overwriting it with the circle face color */ /* Clear the previous line by overwriting it with the circle face
* color
*/
ret = nx_drawline(wndo->hwnd, &wndo->previous, CLEAR_WIDTH, st->facecolor, ret = nx_drawline(wndo->hwnd, &wndo->previous, CLEAR_WIDTH,
NX_LINECAP_NONE); st->facecolor, NX_LINECAP_NONE);
if (ret < 0) if (ret < 0)
{ {
printf("pwlines_update: nx_drawline failed clearing: %d\n", ret); printf("pwlines_update: nx_drawline failed clearing: %d\n", ret);
@ -223,7 +231,6 @@ void pwlines_update(FAR struct pwlines_state_s *st)
printf("pwlines_update: nx_drawline failed clearing: %d\n", ret); printf("pwlines_update: nx_drawline failed clearing: %d\n", ret);
} }
#ifdef CONFIG_NX_ANTIALIASING #ifdef CONFIG_NX_ANTIALIASING
/* If anti-aliasing is enabled, then we must clear a slightly /* If anti-aliasing is enabled, then we must clear a slightly
* larger region to prevent weird edge effects. * larger region to prevent weird edge effects.