OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 University of Szeged | 2 * Copyright (C) 2011 University of Szeged |
3 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> | 3 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> |
4 * All rights reserved. | 4 * All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 76 } |
77 | 77 |
78 m_fillBoundingBox = FloatRect( | 78 m_fillBoundingBox = FloatRect( |
79 FloatPoint( | 79 FloatPoint( |
80 lengthContext.valueForLength(styleRef().svgStyle().x(), styleRef(),
SVGLengthMode::Width), | 80 lengthContext.valueForLength(styleRef().svgStyle().x(), styleRef(),
SVGLengthMode::Width), |
81 lengthContext.valueForLength(styleRef().svgStyle().y(), styleRef(),
SVGLengthMode::Height)), | 81 lengthContext.valueForLength(styleRef().svgStyle().y(), styleRef(),
SVGLengthMode::Height)), |
82 boundingBoxSize); | 82 boundingBoxSize); |
83 m_strokeBoundingBox = m_fillBoundingBox; | 83 m_strokeBoundingBox = m_fillBoundingBox; |
84 if (style()->svgStyle().hasStroke()) | 84 if (style()->svgStyle().hasStroke()) |
85 m_strokeBoundingBox.inflate(strokeWidth() / 2); | 85 m_strokeBoundingBox.inflate(strokeWidth() / 2); |
86 if (element()) | |
87 element()->setNeedsResizeObserverUpdate(); | |
88 } | 86 } |
89 | 87 |
90 bool LayoutSVGRect::shapeDependentStrokeContains(const FloatPoint& point) | 88 bool LayoutSVGRect::shapeDependentStrokeContains(const FloatPoint& point) |
91 { | 89 { |
92 // The optimized code below does not support non-simple strokes so we need | 90 // The optimized code below does not support non-simple strokes so we need |
93 // to fall back to LayoutSVGShape::shapeDependentStrokeContains in these cas
es. | 91 // to fall back to LayoutSVGShape::shapeDependentStrokeContains in these cas
es. |
94 if (m_usePathFallback || !definitelyHasSimpleStroke()) { | 92 if (m_usePathFallback || !definitelyHasSimpleStroke()) { |
95 if (!hasPath()) | 93 if (!hasPath()) |
96 LayoutSVGShape::updateShapeFromElement(); | 94 LayoutSVGShape::updateShapeFromElement(); |
97 return LayoutSVGShape::shapeDependentStrokeContains(point); | 95 return LayoutSVGShape::shapeDependentStrokeContains(point); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // An approximation of sqrt(2) is used here because at certain precise | 137 // An approximation of sqrt(2) is used here because at certain precise |
140 // miterlimits, the join style used might not be correct (e.g. a miterlimit | 138 // miterlimits, the join style used might not be correct (e.g. a miterlimit |
141 // of 1.4142135 should result in bevel joins, but may be drawn using miter | 139 // of 1.4142135 should result in bevel joins, but may be drawn using miter |
142 // joins). | 140 // joins). |
143 return svgStyle.strokeDashArray()->isEmpty() | 141 return svgStyle.strokeDashArray()->isEmpty() |
144 && svgStyle.joinStyle() == MiterJoin | 142 && svgStyle.joinStyle() == MiterJoin |
145 && svgStyle.strokeMiterLimit() >= 1.5; | 143 && svgStyle.strokeMiterLimit() >= 1.5; |
146 } | 144 } |
147 | 145 |
148 } // namespace blink | 146 } // namespace blink |
OLD | NEW |