From 020fd8a9f715b7a0e9f9d9689245ebee1e2e7e18 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 29 Feb 2016 17:27:50 -0800 Subject: Add CFX_FloatRect::ToFxRect(). R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1752543002 . --- core/include/fxcrt/fx_coordinates.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'core/include') diff --git a/core/include/fxcrt/fx_coordinates.h b/core/include/fxcrt/fx_coordinates.h index 2cd249310e..2f52f78b8f 100644 --- a/core/include/fxcrt/fx_coordinates.h +++ b/core/include/fxcrt/fx_coordinates.h @@ -185,10 +185,10 @@ struct FX_RECT { static_cast(right), static_cast(bottom)); } - int left; - int top; - int right; - int bottom; + int32_t left; + int32_t top; + int32_t right; + int32_t bottom; }; // LBRT rectangles (y-axis runs upwards). @@ -220,9 +220,9 @@ class CFX_FloatRect { top = 0.0f; } - FX_BOOL IsEmpty() const { return left >= right || bottom >= top; } - FX_BOOL Contains(const CFX_FloatRect& other_rect) const; - FX_BOOL Contains(FX_FLOAT x, FX_FLOAT y) const; + bool IsEmpty() const { return left >= right || bottom >= top; } + bool Contains(const CFX_FloatRect& other_rect) const; + bool Contains(FX_FLOAT x, FX_FLOAT y) const; void Transform(const CFX_Matrix* pMatrix); void Intersect(const CFX_FloatRect& other_rect); @@ -300,6 +300,11 @@ class CFX_FloatRect { static CFX_FloatRect GetBBox(const CFX_PointF* pPoints, int nPoints); + FX_RECT ToFxRect() const { + return FX_RECT(static_cast(left), static_cast(top), + static_cast(right), static_cast(bottom)); + } + FX_FLOAT left; FX_FLOAT bottom; FX_FLOAT right; -- cgit v1.2.3