summaryrefslogtreecommitdiff
path: root/fpdfsdk/pwl/cpwl_scroll_bar.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-01-18 21:51:17 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-18 21:51:17 +0000
commit27d718ebb2989631d6b4d3425e1fceb4b3bc795b (patch)
treef02b961630ef79eb73d87a554958fd235f22a805 /fpdfsdk/pwl/cpwl_scroll_bar.cpp
parentbbd02f1cd05f55cabee8fbd23a645ac69ac32574 (diff)
downloadpdfium-27d718ebb2989631d6b4d3425e1fceb4b3bc795b.tar.xz
Add jumbo build support for fxge and pwl.
This completes jumbo build support for non-XFA builds. BUG=pdfium:964 Change-Id: Ife4ed23f9b438623581a863685014e64a06cf0d8 Reviewed-on: https://pdfium-review.googlesource.com/22775 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/pwl/cpwl_scroll_bar.cpp')
-rw-r--r--fpdfsdk/pwl/cpwl_scroll_bar.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/fpdfsdk/pwl/cpwl_scroll_bar.cpp b/fpdfsdk/pwl/cpwl_scroll_bar.cpp
index 3ec936730e..65a51e37e8 100644
--- a/fpdfsdk/pwl/cpwl_scroll_bar.cpp
+++ b/fpdfsdk/pwl/cpwl_scroll_bar.cpp
@@ -18,7 +18,7 @@ namespace {
constexpr float kButtonWidth = 9.0f;
constexpr float kPosButtonMinWidth = 2.0f;
-constexpr float kTriangleHalfLength = 2.0f;
+constexpr float kScrollBarTriangleHalfLength = 2.0f;
} // namespace
@@ -153,22 +153,26 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
CFX_PointF pt1;
CFX_PointF pt2;
CFX_PointF pt3;
+ static constexpr float kScrollBarTriangleQuarterLength =
+ kScrollBarTriangleHalfLength * 0.5;
if (m_eSBButtonType == PSBT_MIN) {
- pt1 = CFX_PointF(ptCenter.x - kTriangleHalfLength * 0.5f, ptCenter.y);
- pt2 = CFX_PointF(ptCenter.x + kTriangleHalfLength * 0.5f,
- ptCenter.y + kTriangleHalfLength);
- pt3 = CFX_PointF(ptCenter.x + kTriangleHalfLength * 0.5f,
- ptCenter.y - kTriangleHalfLength);
+ pt1 =
+ CFX_PointF(ptCenter.x - kScrollBarTriangleQuarterLength, ptCenter.y);
+ pt2 = CFX_PointF(ptCenter.x + kScrollBarTriangleQuarterLength,
+ ptCenter.y + kScrollBarTriangleHalfLength);
+ pt3 = CFX_PointF(ptCenter.x + kScrollBarTriangleQuarterLength,
+ ptCenter.y - kScrollBarTriangleHalfLength);
} else if (m_eSBButtonType == PSBT_MAX) {
- pt1 = CFX_PointF(ptCenter.x + kTriangleHalfLength * 0.5f, ptCenter.y);
- pt2 = CFX_PointF(ptCenter.x - kTriangleHalfLength * 0.5f,
- ptCenter.y + kTriangleHalfLength);
- pt3 = CFX_PointF(ptCenter.x - kTriangleHalfLength * 0.5f,
- ptCenter.y - kTriangleHalfLength);
+ pt1 =
+ CFX_PointF(ptCenter.x + kScrollBarTriangleQuarterLength, ptCenter.y);
+ pt2 = CFX_PointF(ptCenter.x - kScrollBarTriangleQuarterLength,
+ ptCenter.y + kScrollBarTriangleHalfLength);
+ pt3 = CFX_PointF(ptCenter.x - kScrollBarTriangleQuarterLength,
+ ptCenter.y - kScrollBarTriangleHalfLength);
}
- if (rectWnd.right - rectWnd.left > kTriangleHalfLength * 2 &&
- rectWnd.top - rectWnd.bottom > kTriangleHalfLength) {
+ if (rectWnd.right - rectWnd.left > kScrollBarTriangleHalfLength * 2 &&
+ rectWnd.top - rectWnd.bottom > kScrollBarTriangleHalfLength) {
CFX_PathData path;
path.AppendPoint(pt1, FXPT_TYPE::MoveTo, false);
path.AppendPoint(pt2, FXPT_TYPE::LineTo, false);