diff options
Diffstat (limited to 'nuttx/libnx/nxtk/nxtk_drawcircletoolbar.c')
-rw-r--r-- | nuttx/libnx/nxtk/nxtk_drawcircletoolbar.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/nuttx/libnx/nxtk/nxtk_drawcircletoolbar.c b/nuttx/libnx/nxtk/nxtk_drawcircletoolbar.c index 3aab9fd6e..390e0e5b5 100644 --- a/nuttx/libnx/nxtk/nxtk_drawcircletoolbar.c +++ b/nuttx/libnx/nxtk/nxtk_drawcircletoolbar.c @@ -113,6 +113,7 @@ int nxtk_drawcircletoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_point_s *cent { struct nxgl_point_s pts[NCIRCLE_POINTS]; FAR struct nxgl_vector_s vector; + bool capped; int i; int ret; @@ -124,15 +125,24 @@ int nxtk_drawcircletoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_point_s *cent for (i = POINT_0p0; i < POINT_337p5; i++) { + /* Draw one line segment */ + vector.pt1.x = pts[i].x; vector.pt1.y = pts[i].y; vector.pt2.x = pts[i+1].x; vector.pt2.y = pts[i+1].y; - ret = nxtk_drawlinetoolbar(hfwnd, &vector, width, color, true); + + ret = nxtk_drawlinetoolbar(hfwnd, &vector, width, color, capped); if (ret != OK) { return ret; } + + /* Every other line segment needs to have a circular line caps to join + * cleanly with the surround lines segments without line caps. + */ + + capped = !capped; } /* The final, closing vector is a special case */ @@ -141,5 +151,5 @@ int nxtk_drawcircletoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_point_s *cent vector.pt1.y = pts[POINT_337p5].y; vector.pt2.x = pts[POINT_0p0].x; vector.pt2.y = pts[POINT_0p0].y; - return nxtk_drawlinetoolbar(hfwnd, &vector, width, color, true); + return nxtk_drawlinetoolbar(hfwnd, &vector, width, color, capped); } |