| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // has a non-scaling or discontinuous stroke. | 64 // has a non-scaling or discontinuous stroke. |
| 65 if (hasNonScalingStroke() || !hasContinuousStroke()) { | 65 if (hasNonScalingStroke() || !hasContinuousStroke()) { |
| 66 RenderSVGShape::updateShapeFromElement(); | 66 RenderSVGShape::updateShapeFromElement(); |
| 67 m_usePathFallback = true; | 67 m_usePathFallback = true; |
| 68 return; | 68 return; |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 m_fillBoundingBox = FloatRect(m_center.x() - m_radii.width(), m_center.y() -
m_radii.height(), 2 * m_radii.width(), 2 * m_radii.height()); | 72 m_fillBoundingBox = FloatRect(m_center.x() - m_radii.width(), m_center.y() -
m_radii.height(), 2 * m_radii.width(), 2 * m_radii.height()); |
| 73 m_strokeBoundingBox = m_fillBoundingBox; | 73 m_strokeBoundingBox = m_fillBoundingBox; |
| 74 if (style()->svgStyle().hasStroke()) | 74 m_strokeBoundingBox.inflate(strokeWidth() / 2); |
| 75 m_strokeBoundingBox.inflate(strokeWidth() / 2); | |
| 76 } | 75 } |
| 77 | 76 |
| 78 void RenderSVGEllipse::calculateRadiiAndCenter() | 77 void RenderSVGEllipse::calculateRadiiAndCenter() |
| 79 { | 78 { |
| 80 ASSERT(element()); | 79 ASSERT(element()); |
| 81 if (isSVGCircleElement(*element())) { | 80 if (isSVGCircleElement(*element())) { |
| 82 SVGCircleElement& circle = toSVGCircleElement(*element()); | 81 SVGCircleElement& circle = toSVGCircleElement(*element()); |
| 83 | 82 |
| 84 SVGLengthContext lengthContext(&circle); | 83 SVGLengthContext lengthContext(&circle); |
| 85 float radius = circle.r()->currentValue()->value(lengthContext); | 84 float radius = circle.r()->currentValue()->value(lengthContext); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 return xrX * xrX + yrY * yrY <= 1.0; | 133 return xrX * xrX + yrY * yrY <= 1.0; |
| 135 } | 134 } |
| 136 | 135 |
| 137 bool RenderSVGEllipse::hasContinuousStroke() const | 136 bool RenderSVGEllipse::hasContinuousStroke() const |
| 138 { | 137 { |
| 139 const SVGRenderStyle& svgStyle = style()->svgStyle(); | 138 const SVGRenderStyle& svgStyle = style()->svgStyle(); |
| 140 return svgStyle.strokeDashArray()->isEmpty(); | 139 return svgStyle.strokeDashArray()->isEmpty(); |
| 141 } | 140 } |
| 142 | 141 |
| 143 } | 142 } |
| OLD | NEW |