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

Unified Diff: core/src/fxcrt/fx_basic_coords.cpp

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 | « core/include/fxcrt/fx_coordinates.h ('k') | fpdfsdk/src/fxedit/fxet_pageobjs.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcrt/fx_basic_coords.cpp
diff --git a/core/src/fxcrt/fx_basic_coords.cpp b/core/src/fxcrt/fx_basic_coords.cpp
index 27feb551131631de5f5f035b9d1c285930326c78..4f723ef919c687f3ca1bbec06d2e65399418f1ac 100644
--- a/core/src/fxcrt/fx_basic_coords.cpp
+++ b/core/src/fxcrt/fx_basic_coords.cpp
@@ -187,22 +187,22 @@ FX_RECT CFX_FloatRect::GetClosestRect() const {
rect.Normalize();
return rect;
}
-FX_BOOL CFX_FloatRect::Contains(const CFX_FloatRect& other_rect) const {
- CFX_FloatRect n1 = *this;
+
+bool CFX_FloatRect::Contains(const CFX_FloatRect& other_rect) const {
+ CFX_FloatRect n1(*this);
+ CFX_FloatRect n2(other_rect);
n1.Normalize();
- CFX_FloatRect n2 = other_rect;
n2.Normalize();
- if (n2.left >= n1.left && n2.right <= n1.right && n2.bottom >= n1.bottom &&
- n2.top <= n1.top) {
- return TRUE;
- }
- return FALSE;
+ return n2.left >= n1.left && n2.right <= n1.right && n2.bottom >= n1.bottom &&
+ n2.top <= n1.top;
}
-FX_BOOL CFX_FloatRect::Contains(FX_FLOAT x, FX_FLOAT y) const {
- CFX_FloatRect n1 = *this;
+
+bool CFX_FloatRect::Contains(FX_FLOAT x, FX_FLOAT y) const {
+ CFX_FloatRect n1(*this);
n1.Normalize();
return x <= n1.right && x >= n1.left && y <= n1.top && y >= n1.bottom;
}
+
void CFX_FloatRect::UpdateRect(FX_FLOAT x, FX_FLOAT y) {
if (left > x) {
left = x;
« no previous file with comments | « core/include/fxcrt/fx_coordinates.h ('k') | fpdfsdk/src/fxedit/fxet_pageobjs.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698