From a4a4db3fff557037ca1d6566e04d0896b932b8e6 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Sat, 6 Oct 2018 05:51:58 +0000 Subject: 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 Reviewed-by: Tom Sepez --- core/fxcrt/fx_coordinates.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'core/fxcrt') 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) { -- cgit v1.2.3