diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-04-05 08:50:01 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-04-05 08:50:01 -0600 |
commit | 0aa9b220495236e5ce855a2fd7565e3ccd94114a (patch) | |
tree | 53a6899895545101d71b84d18adef5c9ae19f0c1 /nuttx/libnx | |
parent | b49b2136f16a49b753e7824cb68f2294599179ac (diff) | |
download | px4-nuttx-0aa9b220495236e5ce855a2fd7565e3ccd94114a.tar.gz px4-nuttx-0aa9b220495236e5ce855a2fd7565e3ccd94114a.tar.bz2 px4-nuttx-0aa9b220495236e5ce855a2fd7565e3ccd94114a.zip |
Add a 'capped' boolean parameter to all drawline/drawLine functions/methods. The idea is that this will produce better joining between lines
Diffstat (limited to 'nuttx/libnx')
-rw-r--r-- | nuttx/libnx/nx/nx_drawcircle.c | 6 | ||||
-rw-r--r-- | nuttx/libnx/nx/nx_drawline.c | 7 | ||||
-rw-r--r-- | nuttx/libnx/nxtk/nxtk_drawcircletoolbar.c | 6 | ||||
-rw-r--r-- | nuttx/libnx/nxtk/nxtk_drawcirclewindow.c | 6 | ||||
-rw-r--r-- | nuttx/libnx/nxtk/nxtk_drawlinetoolbar.c | 7 | ||||
-rw-r--r-- | nuttx/libnx/nxtk/nxtk_drawlinewindow.c | 7 |
6 files changed, 24 insertions, 15 deletions
diff --git a/nuttx/libnx/nx/nx_drawcircle.c b/nuttx/libnx/nx/nx_drawcircle.c index 97f0a4e3f..ea279a45d 100644 --- a/nuttx/libnx/nx/nx_drawcircle.c +++ b/nuttx/libnx/nx/nx_drawcircle.c @@ -1,7 +1,7 @@ /**************************************************************************** * libnx/nx/nx_drawcircle.c * - * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -128,7 +128,7 @@ int nx_drawcircle(NXWINDOW hwnd, FAR const struct nxgl_point_s *center, vector.pt1.y = pts[i].y; vector.pt2.x = pts[i+1].x; vector.pt2.y = pts[i+1].y; - ret = nx_drawline(hwnd, &vector, width, color); + ret = nx_drawline(hwnd, &vector, width, color, true); if (ret != OK) { return ret; @@ -141,5 +141,5 @@ int nx_drawcircle(NXWINDOW hwnd, FAR const struct nxgl_point_s *center, vector.pt1.y = pts[POINT_337p5].y; vector.pt2.x = pts[POINT_0p0].x; vector.pt2.y = pts[POINT_0p0].y; - return nx_drawline(hwnd, &vector, width, color); + return nx_drawline(hwnd, &vector, width, color, true); } diff --git a/nuttx/libnx/nx/nx_drawline.c b/nuttx/libnx/nx/nx_drawline.c index ac47a4418..f29c3b609 100644 --- a/nuttx/libnx/nx/nx_drawline.c +++ b/nuttx/libnx/nx/nx_drawline.c @@ -1,7 +1,7 @@ /**************************************************************************** * libnx/nx/nx_drawline.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -83,6 +83,8 @@ * vector - Describes the line to be drawn * width - The width of the line * color - The color to use to fill the line + * capped - Draw a circular cap both ends of the line to support better + * line joins * * Return: * OK on success; ERROR on failure with errno set appropriately @@ -90,7 +92,8 @@ ****************************************************************************/ int nx_drawline(NXWINDOW hwnd, FAR struct nxgl_vector_s *vector, - nxgl_coord_t width, nxgl_mxpixel_t color[CONFIG_NX_NPLANES]) + nxgl_coord_t width, nxgl_mxpixel_t color[CONFIG_NX_NPLANES], + bool capped) { struct nxgl_trapezoid_s trap[3]; struct nxgl_rect_s rect; diff --git a/nuttx/libnx/nxtk/nxtk_drawcircletoolbar.c b/nuttx/libnx/nxtk/nxtk_drawcircletoolbar.c index fa7905cd4..3aab9fd6e 100644 --- a/nuttx/libnx/nxtk/nxtk_drawcircletoolbar.c +++ b/nuttx/libnx/nxtk/nxtk_drawcircletoolbar.c @@ -1,7 +1,7 @@ /**************************************************************************** * libnx/nxtk/nxtk_drawcircletoolbar.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -128,7 +128,7 @@ int nxtk_drawcircletoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_point_s *cent 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); + ret = nxtk_drawlinetoolbar(hfwnd, &vector, width, color, true); if (ret != OK) { return ret; @@ -141,5 +141,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); + return nxtk_drawlinetoolbar(hfwnd, &vector, width, color, true); } diff --git a/nuttx/libnx/nxtk/nxtk_drawcirclewindow.c b/nuttx/libnx/nxtk/nxtk_drawcirclewindow.c index ec0fe6312..38435d943 100644 --- a/nuttx/libnx/nxtk/nxtk_drawcirclewindow.c +++ b/nuttx/libnx/nxtk/nxtk_drawcirclewindow.c @@ -1,7 +1,7 @@ /**************************************************************************** * libnx/nxtk/nxtk_drawcirclewindow.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -128,7 +128,7 @@ int nxtk_drawcirclewindow(NXTKWINDOW hfwnd, FAR const struct nxgl_point_s *cente vector.pt1.y = pts[i].y; vector.pt2.x = pts[i+1].x; vector.pt2.y = pts[i+1].y; - ret = nxtk_drawlinewindow(hfwnd, &vector, width, color); + ret = nxtk_drawlinewindow(hfwnd, &vector, width, color, true); if (ret != OK) { return ret; @@ -141,5 +141,5 @@ int nxtk_drawcirclewindow(NXTKWINDOW hfwnd, FAR const struct nxgl_point_s *cente vector.pt1.y = pts[POINT_337p5].y; vector.pt2.x = pts[POINT_0p0].x; vector.pt2.y = pts[POINT_0p0].y; - return nxtk_drawlinewindow(hfwnd, &vector, width, color); + return nxtk_drawlinewindow(hfwnd, &vector, width, color, true); } diff --git a/nuttx/libnx/nxtk/nxtk_drawlinetoolbar.c b/nuttx/libnx/nxtk/nxtk_drawlinetoolbar.c index 2bcb8b890..8c2810ce3 100644 --- a/nuttx/libnx/nxtk/nxtk_drawlinetoolbar.c +++ b/nuttx/libnx/nxtk/nxtk_drawlinetoolbar.c @@ -1,7 +1,7 @@ /**************************************************************************** * libnx/nxtk/nxtk_drawlinetoolbar.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -85,6 +85,8 @@ * vector - Describes the line to be drawn * width - The width of the line * color - The color to use to fill the line + * capped - Draw a circular cap both ends of the line to support better + * line joins * * Return: * OK on success; ERROR on failure with errno set appropriately @@ -92,7 +94,8 @@ ****************************************************************************/ int nxtk_drawlinetoolbar(NXTKWINDOW hfwnd, FAR struct nxgl_vector_s *vector, - nxgl_coord_t width, nxgl_mxpixel_t color[CONFIG_NX_NPLANES]) + nxgl_coord_t width, nxgl_mxpixel_t color[CONFIG_NX_NPLANES], + bool capped) { struct nxgl_trapezoid_s trap[3]; diff --git a/nuttx/libnx/nxtk/nxtk_drawlinewindow.c b/nuttx/libnx/nxtk/nxtk_drawlinewindow.c index 176f60b82..8183bf79d 100644 --- a/nuttx/libnx/nxtk/nxtk_drawlinewindow.c +++ b/nuttx/libnx/nxtk/nxtk_drawlinewindow.c @@ -1,7 +1,7 @@ /**************************************************************************** * libnx/nxtk/nxtk_drawlinewindow.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -84,6 +84,8 @@ * vector - Describes the line to be drawn * width - The width of the line * color - The color to use to fill the line + * capped - Draw a circular cap both ends of the line to support better + * line joins * * Return: * OK on success; ERROR on failure with errno set appropriately @@ -91,7 +93,8 @@ ****************************************************************************/ int nxtk_drawlinewindow(NXTKWINDOW hfwnd, FAR struct nxgl_vector_s *vector, - nxgl_coord_t width, nxgl_mxpixel_t color[CONFIG_NX_NPLANES]) + nxgl_coord_t width, nxgl_mxpixel_t color[CONFIG_NX_NPLANES], + bool capped) { struct nxgl_trapezoid_s trap[3]; |