summaryrefslogtreecommitdiff
path: root/fpdfsdk/pwl/cpwl_combo_box.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_combo_box.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_combo_box.cpp')
-rw-r--r--fpdfsdk/pwl/cpwl_combo_box.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/fpdfsdk/pwl/cpwl_combo_box.cpp b/fpdfsdk/pwl/cpwl_combo_box.cpp
index 67d2d88f50..3adbebcadb 100644
--- a/fpdfsdk/pwl/cpwl_combo_box.cpp
+++ b/fpdfsdk/pwl/cpwl_combo_box.cpp
@@ -20,8 +20,8 @@
namespace {
-constexpr float kDefaultFontSize = 12.0f;
-constexpr float kTriangleHalfLength = 3.0f;
+constexpr float kComboBoxDefaultFontSize = 12.0f;
+constexpr float kComboBoxTriangleHalfLength = 3.0f;
constexpr int kDefaultButtonWidth = 13;
} // namespace
@@ -105,14 +105,18 @@ void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
CFX_PointF ptCenter = GetCenterPoint();
- CFX_PointF pt1(ptCenter.x - kTriangleHalfLength,
- ptCenter.y + kTriangleHalfLength * 0.5f);
- CFX_PointF pt2(ptCenter.x + kTriangleHalfLength,
- ptCenter.y + kTriangleHalfLength * 0.5f);
- CFX_PointF pt3(ptCenter.x, ptCenter.y - kTriangleHalfLength * 0.5f);
-
- if (IsFloatBigger(rectWnd.right - rectWnd.left, kTriangleHalfLength * 2) &&
- IsFloatBigger(rectWnd.top - rectWnd.bottom, kTriangleHalfLength)) {
+ static constexpr float kComboBoxTriangleQuarterLength =
+ kComboBoxTriangleHalfLength * 0.5;
+ CFX_PointF pt1(ptCenter.x - kComboBoxTriangleHalfLength,
+ ptCenter.y + kComboBoxTriangleQuarterLength);
+ CFX_PointF pt2(ptCenter.x + kComboBoxTriangleHalfLength,
+ ptCenter.y + kComboBoxTriangleQuarterLength);
+ CFX_PointF pt3(ptCenter.x, ptCenter.y - kComboBoxTriangleQuarterLength);
+
+ if (IsFloatBigger(rectWnd.right - rectWnd.left,
+ kComboBoxTriangleHalfLength * 2) &&
+ IsFloatBigger(rectWnd.top - rectWnd.bottom,
+ kComboBoxTriangleHalfLength)) {
CFX_PathData path;
path.AppendPoint(pt1, FXPT_TYPE::MoveTo, false);
path.AppendPoint(pt2, FXPT_TYPE::LineTo, false);
@@ -304,10 +308,8 @@ void CPWL_ComboBox::CreateListBox(const CreateParams& cp) {
lcp.eCursorType = FXCT_ARROW;
lcp.rcRectWnd = CFX_FloatRect();
- if (cp.dwFlags & PWS_AUTOFONTSIZE)
- lcp.fFontSize = kDefaultFontSize;
- else
- lcp.fFontSize = cp.fFontSize;
+ lcp.fFontSize =
+ (cp.dwFlags & PWS_AUTOFONTSIZE) ? kComboBoxDefaultFontSize : cp.fFontSize;
if (cp.sBorderColor.nColorType == CFX_Color::kTransparent)
lcp.sBorderColor = PWL_DEFAULT_BLACKCOLOR;