summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-15 11:07:32 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-15 17:47:57 +0000
commite4602321f3175fa5addb6761d0e94f5c2fc93d0c (patch)
tree6671774659645fad6d9ce55a5910b4665a25094f /fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
parenteb55885e9a9eec670ed98cbd12dc96d63e6a6623 (diff)
downloadpdfium-e4602321f3175fa5addb6761d0e94f5c2fc93d0c.tar.xz
Cleanup CFX_PathData.
This CL replaces the array of path points with a vector. Cleaning up the usage as required. Change-Id: Ifa386a2c847005fef68af748ebe99c4e08961238 Reviewed-on: https://pdfium-review.googlesource.com/2710 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/pdfwindow/PWL_ScrollBar.cpp')
-rw-r--r--fpdfsdk/pdfwindow/PWL_ScrollBar.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
index 2aa2c7e35f..a202513b92 100644
--- a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
@@ -257,12 +257,10 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN) {
CFX_PathData path;
-
- path.SetPointCount(4);
- path.SetPoint(0, pt1.x, pt1.y, FXPT_TYPE::MoveTo, false);
- path.SetPoint(1, pt2.x, pt2.y, FXPT_TYPE::LineTo, false);
- path.SetPoint(2, pt3.x, pt3.y, FXPT_TYPE::LineTo, false);
- path.SetPoint(3, pt1.x, pt1.y, FXPT_TYPE::LineTo, false);
+ path.AppendPoint(pt1.x, pt1.y, FXPT_TYPE::MoveTo, false);
+ path.AppendPoint(pt2.x, pt2.y, FXPT_TYPE::LineTo, false);
+ path.AppendPoint(pt3.x, pt3.y, FXPT_TYPE::LineTo, false);
+ path.AppendPoint(pt1.x, pt1.y, FXPT_TYPE::LineTo, false);
pDevice->DrawPath(&path, pUser2Device, nullptr,
CPWL_Utils::PWLColorToFXColor(
@@ -280,12 +278,10 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN) {
CFX_PathData path;
-
- path.SetPointCount(4);
- path.SetPoint(0, pt1.x, pt1.y, FXPT_TYPE::MoveTo, false);
- path.SetPoint(1, pt2.x, pt2.y, FXPT_TYPE::LineTo, false);
- path.SetPoint(2, pt3.x, pt3.y, FXPT_TYPE::LineTo, false);
- path.SetPoint(3, pt1.x, pt1.y, FXPT_TYPE::LineTo, false);
+ path.AppendPoint(pt1.x, pt1.y, FXPT_TYPE::MoveTo, false);
+ path.AppendPoint(pt2.x, pt2.y, FXPT_TYPE::LineTo, false);
+ path.AppendPoint(pt3.x, pt3.y, FXPT_TYPE::LineTo, false);
+ path.AppendPoint(pt1.x, pt1.y, FXPT_TYPE::LineTo, false);
pDevice->DrawPath(&path, pUser2Device, nullptr,
CPWL_Utils::PWLColorToFXColor(