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

Unified Diff: Source/core/layout/HitTestLocation.cpp

Issue 952273006: Make the constructor of a LayoutRect from an IntRect explicit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | « Source/core/layout/HitTestLocation.h ('k') | Source/core/layout/Layer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/HitTestLocation.cpp
diff --git a/Source/core/layout/HitTestLocation.cpp b/Source/core/layout/HitTestLocation.cpp
index 07b9a5e5e621d973b4c03a6bb0dece1416c43b4c..fd37f2de430119602396189090ad599dcfc75ad1 100644
--- a/Source/core/layout/HitTestLocation.cpp
+++ b/Source/core/layout/HitTestLocation.cpp
@@ -118,13 +118,13 @@ void HitTestLocation::move(const LayoutSize& offset)
}
template<typename RectType>
-bool HitTestLocation::intersectsRect(const RectType& rect) const
+bool HitTestLocation::intersectsRect(const RectType& rect, const RectType& boundingBox) const
{
// FIXME: When the hit test is not rect based we should use rect.contains(m_point).
// That does change some corner case tests though.
// First check if rect even intersects our bounding box.
- if (!rect.intersects(m_boundingBox))
+ if (!rect.intersects(boundingBox))
return false;
// If the transformed rect is rectilinear the bounding box intersection was accurate.
@@ -132,7 +132,7 @@ bool HitTestLocation::intersectsRect(const RectType& rect) const
return true;
// If rect fully contains our bounding box, we are also sure of an intersection.
- if (rect.contains(m_boundingBox))
+ if (rect.contains(boundingBox))
return true;
// Otherwise we need to do a slower quad based intersection test.
@@ -141,12 +141,12 @@ bool HitTestLocation::intersectsRect(const RectType& rect) const
bool HitTestLocation::intersects(const LayoutRect& rect) const
{
- return intersectsRect(rect);
+ return intersectsRect(rect, LayoutRect(m_boundingBox));
}
bool HitTestLocation::intersects(const FloatRect& rect) const
{
- return intersectsRect(rect);
+ return intersectsRect(rect, FloatRect(m_boundingBox));
}
bool HitTestLocation::intersects(const FloatRoundedRect& rect) const
« no previous file with comments | « Source/core/layout/HitTestLocation.h ('k') | Source/core/layout/Layer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698