Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1336)

Unified Diff: Source/WebCore/platform/graphics/LayoutRect.cpp

Issue 359780043: WIP for IO
Patch Set: Fix inline test while making sure the text test still passes too. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/platform/graphics/LayoutRect.h ('k') | Source/WebCore/rendering/RenderBlock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/LayoutRect.cpp
diff --git a/Source/WebCore/platform/graphics/LayoutRect.cpp b/Source/WebCore/platform/graphics/LayoutRect.cpp
index fd0b6994c334d2569682e2340a1b51969119b341..7f449fba56243b1b4d0d14d517bdc75c266b93b1 100644
--- a/Source/WebCore/platform/graphics/LayoutRect.cpp
+++ b/Source/WebCore/platform/graphics/LayoutRect.cpp
@@ -71,6 +71,22 @@ void LayoutRect::intersect(const LayoutRect& other)
m_size = newMaxPoint - newLocation;
}
+bool LayoutRect::inclusiveIntersect(const LayoutRect& other)
+{
+ LayoutPoint newLocation(std::max(x(), other.x()), std::max(y(), other.y()));
+ LayoutPoint newMaxPoint(std::min(maxX(), other.maxX()), std::min(maxY(), other.maxY()));
+
+ if (newLocation.x() > newMaxPoint.x() || newLocation.y() > newMaxPoint.y()) {
+ newLocation = LayoutPoint(0, 0);
+ newMaxPoint = LayoutPoint(0, 0);
+ return false;
+ }
+
+ m_location = newLocation;
+ m_size = newMaxPoint - newLocation;
+ return true;
+}
+
void LayoutRect::unite(const LayoutRect& other)
{
// Handle empty special cases first.
« no previous file with comments | « Source/WebCore/platform/graphics/LayoutRect.h ('k') | Source/WebCore/rendering/RenderBlock.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b