OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 else | 195 else |
196 maxXIntercept = m_rect.maxX(); | 196 maxXIntercept = m_rect.maxX(); |
197 | 197 |
198 return true; | 198 return true; |
199 } | 199 } |
200 | 200 |
201 void FloatRoundedRect::inflateWithRadii(int size) { | 201 void FloatRoundedRect::inflateWithRadii(int size) { |
202 FloatRect old = m_rect; | 202 FloatRect old = m_rect; |
203 | 203 |
204 m_rect.inflate(size); | 204 m_rect.inflate(size); |
205 // Considering the inflation factor of shorter size to scale the radii seems a
ppropriate here | 205 // Considering the inflation factor of shorter size to scale the radii seems |
| 206 // appropriate here |
206 float factor; | 207 float factor; |
207 if (m_rect.width() < m_rect.height()) | 208 if (m_rect.width() < m_rect.height()) |
208 factor = old.width() ? (float)m_rect.width() / old.width() : int(0); | 209 factor = old.width() ? (float)m_rect.width() / old.width() : int(0); |
209 else | 210 else |
210 factor = old.height() ? (float)m_rect.height() / old.height() : int(0); | 211 factor = old.height() ? (float)m_rect.height() / old.height() : int(0); |
211 | 212 |
212 m_radii.scale(factor); | 213 m_radii.scale(factor); |
213 } | 214 } |
214 | 215 |
215 bool FloatRoundedRect::intersectsQuad(const FloatQuad& quad) const { | 216 bool FloatRoundedRect::intersectsQuad(const FloatQuad& quad) const { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 bottomLeft().toString().ascii().data(), | 372 bottomLeft().toString().ascii().data(), |
372 bottomRight().toString().ascii().data()); | 373 bottomRight().toString().ascii().data()); |
373 } | 374 } |
374 | 375 |
375 String FloatRoundedRect::toString() const { | 376 String FloatRoundedRect::toString() const { |
376 return String::format("%s radii:(%s)", rect().toString().ascii().data(), | 377 return String::format("%s radii:(%s)", rect().toString().ascii().data(), |
377 getRadii().toString().ascii().data()); | 378 getRadii().toString().ascii().data()); |
378 } | 379 } |
379 | 380 |
380 } // namespace blink | 381 } // namespace blink |
OLD | NEW |