summaryrefslogtreecommitdiff
path: root/xfa/fwl/theme/cfwl_scrollbartp.cpp
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2017-02-22 19:56:15 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-23 01:17:40 +0000
commitb147e07ee36be10ca0796a6566be107077c21a03 (patch)
tree637b1b206000a88fb3e198f648e86a9ee5178f1b /xfa/fwl/theme/cfwl_scrollbartp.cpp
parente3f237740fd8bea50b4a6f37f56455dfa0328546 (diff)
downloadpdfium-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 'xfa/fwl/theme/cfwl_scrollbartp.cpp')
-rw-r--r--xfa/fwl/theme/cfwl_scrollbartp.cpp72
1 files changed, 40 insertions, 32 deletions
diff --git a/xfa/fwl/theme/cfwl_scrollbartp.cpp b/xfa/fwl/theme/cfwl_scrollbartp.cpp
index 4cd2fb376d..5f8f7dcd49 100644
--- a/xfa/fwl/theme/cfwl_scrollbartp.cpp
+++ b/xfa/fwl/theme/cfwl_scrollbartp.cpp
@@ -130,30 +130,34 @@ void CFWL_ScrollBarTP::DrawPaw(CFX_Graphics* pGraphics,
if (pRect->width / 2 <= fPawLen) {
fPawLen = (pRect->width - 6) / 2;
}
+
FX_FLOAT fX = pRect->left + pRect->width / 4;
FX_FLOAT fY = pRect->top + pRect->height / 2;
- path.MoveTo(fX, fY - 4);
- path.LineTo(fX + fPawLen, fY - 4);
- path.MoveTo(fX, fY - 2);
- path.LineTo(fX + fPawLen, fY - 2);
- path.MoveTo(fX, fY);
- path.LineTo(fX + fPawLen, fY);
- path.MoveTo(fX, fY + 2);
- path.LineTo(fX + fPawLen, fY + 2);
+ path.MoveTo(CFX_PointF(fX, fY - 4));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY - 4));
+ path.MoveTo(CFX_PointF(fX, fY - 2));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY - 2));
+ path.MoveTo(CFX_PointF(fX, fY));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY));
+ path.MoveTo(CFX_PointF(fX, fY + 2));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY + 2));
+
CFX_Color clrLight(m_pThemeData->clrPawColorLight[eState - 1]);
pGraphics->SetLineWidth(1);
pGraphics->SetStrokeColor(&clrLight);
pGraphics->StrokePath(&path);
fX++;
+
path.Clear();
- path.MoveTo(fX, fY - 3);
- path.LineTo(fX + fPawLen, fY - 3);
- path.MoveTo(fX, fY - 1);
- path.LineTo(fX + fPawLen, fY - 1);
- path.MoveTo(fX, fY + 1);
- path.LineTo(fX + fPawLen, fY + 1);
- path.MoveTo(fX, fY + 3);
- path.LineTo(fX + fPawLen, fY + 3);
+ path.MoveTo(CFX_PointF(fX, fY - 3));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY - 3));
+ path.MoveTo(CFX_PointF(fX, fY - 1));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY - 1));
+ path.MoveTo(CFX_PointF(fX, fY + 1));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY + 1));
+ path.MoveTo(CFX_PointF(fX, fY + 3));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY + 3));
+
CFX_Color clrDark(m_pThemeData->clrPawColorDark[eState - 1]);
pGraphics->SetLineWidth(1);
pGraphics->SetStrokeColor(&clrDark);
@@ -163,30 +167,34 @@ void CFWL_ScrollBarTP::DrawPaw(CFX_Graphics* pGraphics,
if (pRect->height / 2 <= fPawLen) {
fPawLen = (pRect->height - 6) / 2;
}
+
FX_FLOAT fX = pRect->left + pRect->width / 2;
FX_FLOAT fY = pRect->top + pRect->height / 4;
- path.MoveTo(fX - 4, fY);
- path.LineTo(fX - 4, fY + fPawLen);
- path.MoveTo(fX - 2, fY);
- path.LineTo(fX - 2, fY + fPawLen);
- path.MoveTo(fX, fY);
- path.LineTo(fX, fY + fPawLen);
- path.MoveTo(fX + 2, fY);
- path.LineTo(fX + 2, fY + fPawLen);
+ path.MoveTo(CFX_PointF(fX - 4, fY));
+ path.LineTo(CFX_PointF(fX - 4, fY + fPawLen));
+ path.MoveTo(CFX_PointF(fX - 2, fY));
+ path.LineTo(CFX_PointF(fX - 2, fY + fPawLen));
+ path.MoveTo(CFX_PointF(fX, fY));
+ path.LineTo(CFX_PointF(fX, fY + fPawLen));
+ path.MoveTo(CFX_PointF(fX + 2, fY));
+ path.LineTo(CFX_PointF(fX + 2, fY + fPawLen));
+
CFX_Color clrLight(m_pThemeData->clrPawColorLight[eState - 1]);
pGraphics->SetLineWidth(1);
pGraphics->SetStrokeColor(&clrLight);
pGraphics->StrokePath(&path, pMatrix);
fY++;
+
path.Clear();
- path.MoveTo(fX - 3, fY);
- path.LineTo(fX - 3, fY + fPawLen);
- path.MoveTo(fX - 1, fY);
- path.LineTo(fX - 1, fY + fPawLen);
- path.MoveTo(fX + 1, fY);
- path.LineTo(fX + 1, fY + fPawLen);
- path.MoveTo(fX + 3, fY);
- path.LineTo(fX + 3, fY + fPawLen);
+ path.MoveTo(CFX_PointF(fX - 3, fY));
+ path.LineTo(CFX_PointF(fX - 3, fY + fPawLen));
+ path.MoveTo(CFX_PointF(fX - 1, fY));
+ path.LineTo(CFX_PointF(fX - 1, fY + fPawLen));
+ path.MoveTo(CFX_PointF(fX + 1, fY));
+ path.LineTo(CFX_PointF(fX + 1, fY + fPawLen));
+ path.MoveTo(CFX_PointF(fX + 3, fY));
+ path.LineTo(CFX_PointF(fX + 3, fY + fPawLen));
+
CFX_Color clrDark(m_pThemeData->clrPawColorDark[eState - 1]);
pGraphics->SetLineWidth(1);
pGraphics->SetStrokeColor(&clrDark);