Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2093)

Unified Diff: core/include/fxcrt/fx_coordinates.h

Issue 1752543002: Add CFX_FloatRect::ToFxRect(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/src/fxcrt/fx_basic_coords.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fxcrt/fx_coordinates.h
diff --git a/core/include/fxcrt/fx_coordinates.h b/core/include/fxcrt/fx_coordinates.h
index 2cd249310e8e2b2fa9dd43f574201723182fd1c0..2f52f78b8f77331b11aeeb569d0c007d573ab7d3 100644
--- a/core/include/fxcrt/fx_coordinates.h
+++ b/core/include/fxcrt/fx_coordinates.h
@@ -185,10 +185,10 @@ struct FX_RECT {
static_cast<uint16_t>(right), static_cast<uint16_t>(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<int32_t>(left), static_cast<int32_t>(top),
+ static_cast<int32_t>(right), static_cast<int32_t>(bottom));
+ }
+
FX_FLOAT left;
FX_FLOAT bottom;
FX_FLOAT right;
« no previous file with comments | « no previous file | core/src/fxcrt/fx_basic_coords.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698