drawline/drawLine should not take a boolean to select non lines caps or capping at both ends. drawline/drawLine also needs to be able to put a line cap on one one end of a line

This commit is contained in:
Gregory Nutt 2015-04-05 16:53:51 -06:00
parent a13cdd2c39
commit f6604c7e5c
11 changed files with 35 additions and 27 deletions

View file

@ -285,7 +285,7 @@ namespace NXWidgets
* @param vector - Describes the line to be drawn
* @param width - The width of the line
* @param color - The color to use to fill the line
* @param capped - Draw a circular cap both ends of the line to support
* @param caps - Draw a circular cap on the ends of the line to support
* better line joins
*
* @return True on success; false on failure.
@ -293,7 +293,7 @@ namespace NXWidgets
bool drawLine(FAR struct nxgl_vector_s *vector,
nxgl_coord_t width, nxgl_mxpixel_t color,
bool capped);
enum ELineCaps caps);
/**
* Draw a filled circle at the specified position, size, and color.

View file

@ -242,13 +242,13 @@ namespace NXWidgets
* @param x2 The x coordinate of the end point of the line.
* @param y2 The y coordinate of the end point of the line.
* @param color The color of the line.
* @param capped Draw a circular cap both ends of the line to support
* @param caps Draw a circular cap on the ends of the line to support
* better line joins
*/
void drawLine(nxgl_coord_t x1, nxgl_coord_t y1,
nxgl_coord_t x2, nxgl_coord_t y2,
nxgl_mxpixel_t color, bool capped);
nxgl_mxpixel_t color, enum INxWindow::ELineCaps caps);
/**
* Draw a filled rectangle of the specified start position, end position,

View file

@ -306,7 +306,7 @@ namespace NXWidgets
* @param vector - Describes the line to be drawn
* @param width - The width of the line
* @param color - The color to use to fill the line
* @param capped - Draw a circular cap both ends of the line to support
* @param caps - Draw a circular cap on the ends of the line to support
* better line joins
*
* @return True on success; false on failure.
@ -314,7 +314,7 @@ namespace NXWidgets
bool drawLine(FAR struct nxgl_vector_s *vector,
nxgl_coord_t width, nxgl_mxpixel_t color,
bool capped);
enum ELineCaps caps);
/**
* Draw a filled circle at the specified position, size, and color.

View file

@ -275,7 +275,7 @@ namespace NXWidgets
* @param vector - Describes the line to be drawn
* @param width - The width of the line
* @param color - The color to use to fill the line
* @param capped - Draw a circular cap both ends of the line to suppor
* @param caps - Draw a circular cap on the ends of the line to suppor
* better line joins
*
* @return True on success; false on failure.
@ -283,7 +283,7 @@ namespace NXWidgets
bool drawLine(FAR struct nxgl_vector_s *vector,
nxgl_coord_t width, nxgl_mxpixel_t color,
bool capped);
enum ELineCaps caps);
/**
* Draw a filled circle at the specified position, size, and color.

View file

@ -279,7 +279,7 @@ namespace NXWidgets
* @param vector - Describes the line to be drawn
* @param width - The width of the line
* @param color - The color to use to fill the line
* @param capped - Draw a circular cap both ends of the line to support
* @param caps - Draw a circular cap on the ends of the line to support
* better line joins
*
* @return True on success; false on failure.
@ -287,7 +287,7 @@ namespace NXWidgets
bool drawLine(FAR struct nxgl_vector_s *vector,
nxgl_coord_t width, nxgl_mxpixel_t color,
bool capped);
enum ELineCaps caps);
/**
* Draw a filled circle at the specified position, size, and color.

View file

@ -83,6 +83,14 @@ namespace NXWidgets
class INxWindow
{
public:
enum ELineCaps
{
LINECAP_NONE = NX_LINECAP_NONE, // No line caps
LINECAP_PT1 = NX_LINECAP_PT1, // Line cap on pt1 of the vector only
LINECAP_PT2 = NX_LINECAP_PT2, // Line cap on pt2 of the vector only
LINECAP_BOTH = NX_LINECAP_BOTH // Line cap on both ends of the vector only
};
/**
* A virtual destructor is required in order to override the INxWindow
* destructor. We do this because if we delete INxWindow, we want the
@ -249,7 +257,7 @@ namespace NXWidgets
* @param vector - Describes the line to be drawn
* @param width - The width of the line
* @param color - The color to use to fill the line
* @param capped - Draw a circular cap both ends of the line to support
* @param caps - Draw a circular cap on the ends of the line to support
* better line joins
*
* @return True on success; false on failure.
@ -257,7 +265,7 @@ namespace NXWidgets
virtual bool drawLine(FAR struct nxgl_vector_s *vector,
nxgl_coord_t width, nxgl_mxpixel_t color,
bool capped) = 0;
enum ELineCaps caps) = 0;
/**
* Draw a filled circle at the specified position, size, and color.