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

Side by Side Diff: Source/core/layout/HitTestLocation.cpp

Issue 1303413004: Convert some call sites to use explicit LayoutRect->FloatRect conversion. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/InspectorTraceEvents.cpp ('k') | Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 // If the transformed rect is rectilinear the bounding box intersection was accurate. 130 // If the transformed rect is rectilinear the bounding box intersection was accurate.
131 if (m_isRectilinear) 131 if (m_isRectilinear)
132 return true; 132 return true;
133 133
134 // If rect fully contains our bounding box, we are also sure of an intersect ion. 134 // If rect fully contains our bounding box, we are also sure of an intersect ion.
135 if (rect.contains(boundingBox)) 135 if (rect.contains(boundingBox))
136 return true; 136 return true;
137 137
138 // Otherwise we need to do a slower quad based intersection test. 138 // Otherwise we need to do a slower quad based intersection test.
139 return m_transformedRect.intersectsRect(rect); 139 return m_transformedRect.intersectsRect(FloatRect(rect));
140 } 140 }
141 141
142 bool HitTestLocation::intersects(const LayoutRect& rect) const 142 bool HitTestLocation::intersects(const LayoutRect& rect) const
143 { 143 {
144 return intersectsRect(rect, LayoutRect(m_boundingBox)); 144 return intersectsRect(rect, LayoutRect(m_boundingBox));
145 } 145 }
146 146
147 bool HitTestLocation::intersects(const FloatRect& rect) const 147 bool HitTestLocation::intersects(const FloatRect& rect) const
148 { 148 {
149 return intersectsRect(rect, FloatRect(m_boundingBox)); 149 return intersectsRect(rect, FloatRect(m_boundingBox));
(...skipping 16 matching lines...) Expand all
166 166
167 IntSize actualPadding(leftPadding + rightPadding, topPadding + bottomPadding ); 167 IntSize actualPadding(leftPadding + rightPadding, topPadding + bottomPadding );
168 // As IntRect is left inclusive and right exclusive (seeing IntRect::contain s(x, y)), adding "1". 168 // As IntRect is left inclusive and right exclusive (seeing IntRect::contain s(x, y)), adding "1".
169 // FIXME: Remove this once non-rect based hit-detection stops using IntRect: intersects. 169 // FIXME: Remove this once non-rect based hit-detection stops using IntRect: intersects.
170 actualPadding += IntSize(1, 1); 170 actualPadding += IntSize(1, 1);
171 171
172 return IntRect(actualPoint, actualPadding); 172 return IntRect(actualPoint, actualPadding);
173 } 173 }
174 174
175 } // namespace blink 175 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorTraceEvents.cpp ('k') | Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698