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

Side by Side Diff: Source/platform/geometry/FloatRect.h

Issue 1072403007: Fixup a bug about SVG text selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add a line. Created 5 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2005 Nokia. All rights reserved. 3 * Copyright (C) 2005 Nokia. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 void shiftMaxYEdgeTo(float edge) 125 void shiftMaxYEdgeTo(float edge)
126 { 126 {
127 float delta = edge - maxY(); 127 float delta = edge - maxY();
128 setHeight(std::max(0.0f, height() + delta)); 128 setHeight(std::max(0.0f, height() + delta));
129 } 129 }
130 130
131 FloatPoint minXMinYCorner() const { return m_location; } // typically topLef t 131 FloatPoint minXMinYCorner() const { return m_location; } // typically topLef t
132 FloatPoint maxXMinYCorner() const { return FloatPoint(m_location.x() + m_siz e.width(), m_location.y()); } // typically topRight 132 FloatPoint maxXMinYCorner() const { return FloatPoint(m_location.x() + m_siz e.width(), m_location.y()); } // typically topRight
133 FloatPoint minXMaxYCorner() const { return FloatPoint(m_location.x(), m_loca tion.y() + m_size.height()); } // typically bottomLeft 133 FloatPoint minXMaxYCorner() const { return FloatPoint(m_location.x(), m_loca tion.y() + m_size.height()); } // typically bottomLeft
134 FloatPoint maxXMaxYCorner() const { return FloatPoint(m_location.x() + m_siz e.width(), m_location.y() + m_size.height()); } // typically bottomRight 134 FloatPoint maxXMaxYCorner() const { return FloatPoint(m_location.x() + m_siz e.width(), m_location.y() + m_size.height()); } // typically bottomRight
135 FloatPoint leftEdgeMidPoint() const { return FloatPoint(m_location.x(), m_lo cation.y() + m_size.height() / 2); }
136 FloatPoint rightEdgeMidPoint() const { return FloatPoint(m_location.x() + m_ size.width(), m_location.y() + m_size.height() / 2); }
135 137
136 bool intersects(const FloatRect&) const; 138 bool intersects(const FloatRect&) const;
137 bool contains(const FloatRect&) const; 139 bool contains(const FloatRect&) const;
138 bool contains(const FloatPoint&, ContainsMode = InsideOrOnStroke) const; 140 bool contains(const FloatPoint&, ContainsMode = InsideOrOnStroke) const;
139 141
140 void intersect(const FloatRect&); 142 void intersect(const FloatRect&);
141 void unite(const FloatRect&); 143 void unite(const FloatRect&);
142 void uniteEvenIfEmpty(const FloatRect&); 144 void uniteEvenIfEmpty(const FloatRect&);
143 void uniteIfNonZero(const FloatRect&); 145 void uniteIfNonZero(const FloatRect&);
144 void extend(const FloatPoint&); 146 void extend(const FloatPoint&);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 PLATFORM_EXPORT IntRect enclosedIntRect(const FloatRect&); 243 PLATFORM_EXPORT IntRect enclosedIntRect(const FloatRect&);
242 244
243 PLATFORM_EXPORT IntRect roundedIntRect(const FloatRect&); 245 PLATFORM_EXPORT IntRect roundedIntRect(const FloatRect&);
244 246
245 // Map supplied rect from srcRect to an equivalent rect in destRect. 247 // Map supplied rect from srcRect to an equivalent rect in destRect.
246 PLATFORM_EXPORT FloatRect mapRect(const FloatRect&, const FloatRect& srcRect, co nst FloatRect& destRect); 248 PLATFORM_EXPORT FloatRect mapRect(const FloatRect&, const FloatRect& srcRect, co nst FloatRect& destRect);
247 249
248 } 250 }
249 251
250 #endif 252 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698