summaryrefslogtreecommitdiff
path: root/xfa/fwl/theme
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-08-26 01:49:44 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-08-28 19:20:53 +0000
commit9084a1286c8cd9ead4d6d7bd177a22a3c67d3afb (patch)
treefdca0d663a448ef5512dc34b04786b75558ef669 /xfa/fwl/theme
parent61cb1121729d7e5f53c95077dcc57a61b3f575e8 (diff)
downloadpdfium-9084a1286c8cd9ead4d6d7bd177a22a3c67d3afb.tar.xz
Remove unused / rarely used CFX_PTemplate methods.
CFX_Point and CFX_PointF are derived from CFX_PTemplate. Add a helper function to replace the rarely used method where its used. Change-Id: I28448d44bbae9aa6773d1ad5fd7daf342b67c84c Reviewed-on: https://pdfium-review.googlesource.com/12071 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fwl/theme')
-rw-r--r--xfa/fwl/theme/cfwl_checkboxtp.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp
index e783098347..8d73738aab 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -20,6 +20,13 @@ namespace {
const int kSignPath = 100;
+CFX_PointF ScaleBezierPoint(const CFX_PointF& point) {
+ CFX_PointF scaled_point(point);
+ scaled_point.x *= FX_BEZIER;
+ scaled_point.y *= FX_BEZIER;
+ return scaled_point;
+}
+
} // namespace
#define CHECKBOX_COLOR_BOXLT1 (ArgbEncode(255, 172, 168, 153))
@@ -234,24 +241,24 @@ void CFWL_CheckBoxTP::InitCheckPath(float fCheckLen) {
CFX_PointF pt15(fWidth / 3.5f, fBottom + fHeight * 3.5f / 5.0f);
m_pCheckPath->MoveTo(pt1);
- CFX_PointF p1 = CFX_PointF(pt12.x - pt1.x, pt12.y - pt1.y) * FX_BEZIER;
- CFX_PointF p2 = CFX_PointF(pt21.x - pt2.x, pt21.y - pt2.y) * FX_BEZIER;
+ CFX_PointF p1 = ScaleBezierPoint(pt12 - pt1);
+ CFX_PointF p2 = ScaleBezierPoint(pt21 - pt2);
m_pCheckPath->BezierTo(pt1 + p1, pt2 + p2, pt2);
- p1 = CFX_PointF(pt23.x - pt2.x, pt23.y - pt2.y) * FX_BEZIER;
- p2 = CFX_PointF(pt32.x - pt3.x, pt32.y - pt3.y) * FX_BEZIER;
+ p1 = ScaleBezierPoint(pt23 - pt2);
+ p2 = ScaleBezierPoint(pt32 - pt3);
m_pCheckPath->BezierTo(pt2 + p1, pt3 + p2, pt3);
- p1 = CFX_PointF(pt34.x - pt3.x, pt34.y - pt3.y) * FX_BEZIER;
- p2 = CFX_PointF(pt43.x - pt4.x, pt43.y - pt4.y) * FX_BEZIER;
+ p1 = ScaleBezierPoint(pt34 - pt3);
+ p2 = ScaleBezierPoint(pt43 - pt4);
m_pCheckPath->BezierTo(pt3 + p1, pt4 + p2, pt4);
- p1 = CFX_PointF(pt45.x - pt4.x, pt45.y - pt4.y) * FX_BEZIER;
- p2 = CFX_PointF(pt54.x - pt5.x, pt54.y - pt5.y) * FX_BEZIER;
+ p1 = ScaleBezierPoint(pt45 - pt4);
+ p2 = ScaleBezierPoint(pt54 - pt5);
m_pCheckPath->BezierTo(pt4 + p1, pt5 + p2, pt5);
- p1 = CFX_PointF(pt51.x - pt5.x, pt51.y - pt5.y) * FX_BEZIER;
- p2 = CFX_PointF(pt15.x - pt1.x, pt15.y - pt1.y) * FX_BEZIER;
+ p1 = ScaleBezierPoint(pt51 - pt5);
+ p2 = ScaleBezierPoint(pt15 - pt1);
m_pCheckPath->BezierTo(pt5 + p1, pt1 + p2, pt1);
float fScale = fCheckLen / kSignPath;