diff options
author | dan sinclair <dsinclair@chromium.org> | 2017-02-22 19:56:15 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-23 01:17:40 +0000 |
commit | b147e07ee36be10ca0796a6566be107077c21a03 (patch) | |
tree | 637b1b206000a88fb3e198f648e86a9ee5178f1b /core/fxge/cfx_pathdata.h | |
parent | e3f237740fd8bea50b4a6f37f56455dfa0328546 (diff) | |
download | pdfium-b147e07ee36be10ca0796a6566be107077c21a03.tar.xz |
Convert point x,y into CFX_PointF
This Cl converts the PointX,PointY pairs into a CFX_PointF.
Change-Id: I46897832077c317a5bffb4e568550705decbc40c
Reviewed-on: https://pdfium-review.googlesource.com/2821
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fxge/cfx_pathdata.h')
-rw-r--r-- | core/fxge/cfx_pathdata.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/core/fxge/cfx_pathdata.h b/core/fxge/cfx_pathdata.h index 14a8d992b9..68939bfeb2 100644 --- a/core/fxge/cfx_pathdata.h +++ b/core/fxge/cfx_pathdata.h @@ -13,13 +13,18 @@ #include "core/fxcrt/fx_system.h" #include "core/fxge/cfx_renderdevice.h" -struct FX_PATHPOINT { +class FX_PATHPOINT { + public: + FX_PATHPOINT(); + FX_PATHPOINT(const CFX_PointF& point, FXPT_TYPE type, bool close); + FX_PATHPOINT(const FX_PATHPOINT& other); + ~FX_PATHPOINT(); + bool IsTypeAndOpen(FXPT_TYPE type) const { return m_Type == type && !m_CloseFigure; } - FX_FLOAT m_PointX; - FX_FLOAT m_PointY; + CFX_PointF m_Point; FXPT_TYPE m_Type; bool m_CloseFigure; }; @@ -37,8 +42,7 @@ class CFX_PathData { return m_Points[index].m_CloseFigure; } - FX_FLOAT GetPointX(int index) const { return m_Points[index].m_PointX; } - FX_FLOAT GetPointY(int index) const { return m_Points[index].m_PointY; } + CFX_PointF GetPoint(int index) const { return m_Points[index].m_Point; } const std::vector<FX_PATHPOINT>& GetPoints() const { return m_Points; } std::vector<FX_PATHPOINT>& GetPoints() { return m_Points; } @@ -57,7 +61,7 @@ class CFX_PathData { void Append(const CFX_PathData& data); void Append(const CFX_PathData* pSrc, const CFX_Matrix* pMatrix); void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top); - void AppendPoint(FX_FLOAT x, FX_FLOAT y, FXPT_TYPE type, bool closeFigure); + void AppendPoint(const CFX_PointF& pos, FXPT_TYPE type, bool closeFigure); void ClosePath(); private: |