diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-06 05:51:58 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-06 05:51:58 +0000 |
commit | a4a4db3fff557037ca1d6566e04d0896b932b8e6 (patch) | |
tree | 8ce489321f45fa6ac159916370d8a9476de4f04e | |
parent | 28995e606991189ddc4fdc8aba5db438554f5ce2 (diff) | |
download | pdfium-a4a4db3fff557037ca1d6566e04d0896b932b8e6.tar.xz |
Simplify CFX_FloatRect::Inflate() and Deflate().
Make all the other Inflate() methods to call the 4 parameters version.
Make all the other Deflate() methods to call the 4 parameters version.
Make the 4 parameters version of Deflate() call Inflate().
Change-Id: I1d2702898206bf9845f0bb176c2bf4d5a315cf96
Reviewed-on: https://pdfium-review.googlesource.com/c/43573
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
-rw-r--r-- | core/fxcrt/fx_coordinates.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/core/fxcrt/fx_coordinates.cpp b/core/fxcrt/fx_coordinates.cpp index e08b13e97b..f85394ca5c 100644 --- a/core/fxcrt/fx_coordinates.cpp +++ b/core/fxcrt/fx_coordinates.cpp @@ -206,11 +206,7 @@ void CFX_FloatRect::UpdateRect(const CFX_PointF& point) { } void CFX_FloatRect::Inflate(float x, float y) { - Normalize(); - left -= x; - right += x; - bottom -= y; - top += y; + Inflate(x, y, x, y); } void CFX_FloatRect::Inflate(float other_left, @@ -229,22 +225,14 @@ void CFX_FloatRect::Inflate(const CFX_FloatRect& rt) { } void CFX_FloatRect::Deflate(float x, float y) { - Normalize(); - left += x; - right -= x; - bottom += y; - top -= y; + Deflate(x, y, x, y); } void CFX_FloatRect::Deflate(float other_left, float other_bottom, float other_right, float other_top) { - Normalize(); - left += other_left; - bottom += other_bottom; - right -= other_right; - top -= other_top; + Inflate(-other_left, -other_bottom, -other_right, -other_top); } void CFX_FloatRect::Deflate(const CFX_FloatRect& rt) { |