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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 FloatRect(m_center.x() - m_radii.width(), m_center.y() - m_radii.height(), | 69 FloatRect(m_center.x() - m_radii.width(), m_center.y() - m_radii.height(), |
70 2 * m_radii.width(), 2 * m_radii.height()); | 70 2 * m_radii.width(), 2 * m_radii.height()); |
71 m_strokeBoundingBox = m_fillBoundingBox; | 71 m_strokeBoundingBox = m_fillBoundingBox; |
72 if (style()->svgStyle().hasStroke()) | 72 if (style()->svgStyle().hasStroke()) |
73 m_strokeBoundingBox.inflate(strokeWidth() / 2); | 73 m_strokeBoundingBox.inflate(strokeWidth() / 2); |
74 if (element()) | 74 if (element()) |
75 element()->setNeedsResizeObserverUpdate(); | 75 element()->setNeedsResizeObserverUpdate(); |
76 } | 76 } |
77 | 77 |
78 void LayoutSVGEllipse::calculateRadiiAndCenter() { | 78 void LayoutSVGEllipse::calculateRadiiAndCenter() { |
79 ASSERT(element()); | 79 DCHECK(element()); |
80 SVGLengthContext lengthContext(element()); | 80 SVGLengthContext lengthContext(element()); |
81 m_center = FloatPoint( | 81 m_center = FloatPoint( |
82 lengthContext.valueForLength(style()->svgStyle().cx(), styleRef(), | 82 lengthContext.valueForLength(style()->svgStyle().cx(), styleRef(), |
83 SVGLengthMode::Width), | 83 SVGLengthMode::Width), |
84 lengthContext.valueForLength(style()->svgStyle().cy(), styleRef(), | 84 lengthContext.valueForLength(style()->svgStyle().cy(), styleRef(), |
85 SVGLengthMode::Height)); | 85 SVGLengthMode::Height)); |
86 | 86 |
87 if (isSVGCircleElement(*element())) { | 87 if (isSVGCircleElement(*element())) { |
88 float radius = lengthContext.valueForLength( | 88 float radius = lengthContext.valueForLength( |
89 style()->svgStyle().r(), styleRef(), SVGLengthMode::Other); | 89 style()->svgStyle().r(), styleRef(), SVGLengthMode::Other); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 const float yrY = center.y() / m_radii.height(); | 126 const float yrY = center.y() / m_radii.height(); |
127 return xrX * xrX + yrY * yrY <= 1.0; | 127 return xrX * xrX + yrY * yrY <= 1.0; |
128 } | 128 } |
129 | 129 |
130 bool LayoutSVGEllipse::hasContinuousStroke() const { | 130 bool LayoutSVGEllipse::hasContinuousStroke() const { |
131 const SVGComputedStyle& svgStyle = style()->svgStyle(); | 131 const SVGComputedStyle& svgStyle = style()->svgStyle(); |
132 return svgStyle.strokeDashArray()->isEmpty(); | 132 return svgStyle.strokeDashArray()->isEmpty(); |
133 } | 133 } |
134 | 134 |
135 } // namespace blink | 135 } // namespace blink |
OLD | NEW |