diff options
author | Lei Zhang <thestig@chromium.org> | 2018-03-15 15:02:22 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-03-15 15:02:22 +0000 |
commit | 9875889910585b08d2abd372ddc95469baf1a7e9 (patch) | |
tree | dac7825a580bed8bc2767e4e877c814705e6b783 /fpdfsdk/pwl/cpwl_appstream.cpp | |
parent | 0a68fd65bb2ced78bc57769cde8ecd16a175c84f (diff) | |
download | pdfium-9875889910585b08d2abd372ddc95469baf1a7e9.tar.xz |
Use Width()/Height() methods from rectangles.
Change-Id: I07f4363046be920816e8d0dae766c7af833284db
Reviewed-on: https://pdfium-review.googlesource.com/28582
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/pwl/cpwl_appstream.cpp')
-rw-r--r-- | fpdfsdk/pwl/cpwl_appstream.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fpdfsdk/pwl/cpwl_appstream.cpp b/fpdfsdk/pwl/cpwl_appstream.cpp index 203a634bfa..38144d1735 100644 --- a/fpdfsdk/pwl/cpwl_appstream.cpp +++ b/fpdfsdk/pwl/cpwl_appstream.cpp @@ -129,8 +129,8 @@ ByteString GetColorAppStream(const CFX_Color& color, } ByteString GetAP_Check(const CFX_FloatRect& crBBox) { - const float fWidth = crBBox.right - crBBox.left; - const float fHeight = crBBox.top - crBBox.bottom; + const float fWidth = crBBox.Width(); + const float fHeight = crBBox.Height(); CFX_PointF pts[8][3] = {{CFX_PointF(0.28f, 0.52f), CFX_PointF(0.27f, 0.48f), CFX_PointF(0.29f, 0.40f)}, @@ -180,8 +180,8 @@ ByteString GetAP_Check(const CFX_FloatRect& crBBox) { ByteString GetAP_Circle(const CFX_FloatRect& crBBox) { std::ostringstream csAP; - float fWidth = crBBox.right - crBBox.left; - float fHeight = crBBox.top - crBBox.bottom; + float fWidth = crBBox.Width(); + float fHeight = crBBox.Height(); CFX_PointF pt1(crBBox.left, crBBox.bottom + fHeight / 2); CFX_PointF pt2(crBBox.left + fWidth / 2, crBBox.top); @@ -236,8 +236,8 @@ ByteString GetAP_Cross(const CFX_FloatRect& crBBox) { ByteString GetAP_Diamond(const CFX_FloatRect& crBBox) { std::ostringstream csAP; - float fWidth = crBBox.right - crBBox.left; - float fHeight = crBBox.top - crBBox.bottom; + float fWidth = crBBox.Width(); + float fHeight = crBBox.Height(); CFX_PointF pt1(crBBox.left, crBBox.bottom + fHeight / 2); CFX_PointF pt2(crBBox.left + fWidth / 2, crBBox.top); @@ -298,8 +298,8 @@ ByteString GetAP_Star(const CFX_FloatRect& crBBox) { ByteString GetAP_HalfCircle(const CFX_FloatRect& crBBox, float fRotate) { std::ostringstream csAP; - float fWidth = crBBox.right - crBBox.left; - float fHeight = crBBox.top - crBBox.bottom; + float fWidth = crBBox.Width(); + float fHeight = crBBox.Height(); CFX_PointF pt1(-fWidth / 2, 0); CFX_PointF pt2(0, fHeight / 2); @@ -776,7 +776,7 @@ ByteString GetPushButtonAppStream(const CFX_FloatRect& rcBBox, case ButtonStyle::kIconTopLabelBottom: if (pIconStream) { if (IsFloatZero(fFontSize)) { - fHeight = rcBBox.top - rcBBox.bottom; + fHeight = rcBBox.Height(); rcLabel = CFX_FloatRect(rcBBox.left, rcBBox.bottom, rcBBox.right, rcBBox.bottom + fHeight * fAutoFontScale); rcIcon = @@ -800,7 +800,7 @@ ByteString GetPushButtonAppStream(const CFX_FloatRect& rcBBox, case ButtonStyle::kIconBottomLabelTop: if (pIconStream) { if (IsFloatZero(fFontSize)) { - fHeight = rcBBox.top - rcBBox.bottom; + fHeight = rcBBox.Height(); rcLabel = CFX_FloatRect(rcBBox.left, rcBBox.top - fHeight * fAutoFontScale, rcBBox.right, rcBBox.top); |