OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google, Inc. | 2 * Copyright (C) 2012 Google, Inc. |
3 * All rights reserved. | 3 * 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 13 matching lines...) Expand all Loading... |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 | 28 |
29 #include "core/rendering/svg/RenderSVGEllipse.h" | 29 #include "core/rendering/svg/RenderSVGEllipse.h" |
30 | 30 |
31 #include "SVGNames.h" | 31 #include "SVGNames.h" |
32 #include "core/svg/SVGCircleElement.h" | 32 #include "core/svg/SVGCircleElement.h" |
33 #include "core/svg/SVGEllipseElement.h" | 33 #include "core/svg/SVGEllipseElement.h" |
34 #include "core/svg/SVGStyledTransformableElement.h" | |
35 | 34 |
36 namespace WebCore { | 35 namespace WebCore { |
37 | 36 |
38 RenderSVGEllipse::RenderSVGEllipse(SVGStyledTransformableElement* node) | 37 RenderSVGEllipse::RenderSVGEllipse(SVGStyledTransformableElement* node) |
39 : RenderSVGShape(node) | 38 : RenderSVGShape(node) |
40 , m_usePathFallback(false) | 39 , m_usePathFallback(false) |
41 { | 40 { |
42 } | 41 } |
43 | 42 |
44 RenderSVGEllipse::~RenderSVGEllipse() | 43 RenderSVGEllipse::~RenderSVGEllipse() |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 FloatPoint center = FloatPoint(m_center.x() - point.x(), m_center.y() - poin
t.y()); | 148 FloatPoint center = FloatPoint(m_center.x() - point.x(), m_center.y() - poin
t.y()); |
150 | 149 |
151 // This works by checking if the point satisfies the ellipse equation. | 150 // This works by checking if the point satisfies the ellipse equation. |
152 // (x/rX)^2 + (y/rY)^2 <= 1 | 151 // (x/rX)^2 + (y/rY)^2 <= 1 |
153 float xrX = center.x() / m_radii.width(); | 152 float xrX = center.x() / m_radii.width(); |
154 float yrY = center.y() / m_radii.height(); | 153 float yrY = center.y() / m_radii.height(); |
155 return xrX * xrX + yrY * yrY <= 1.0; | 154 return xrX * xrX + yrY * yrY <= 1.0; |
156 } | 155 } |
157 | 156 |
158 } | 157 } |
OLD | NEW |