OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2006 Apple Computer, Inc | 5 * Copyright (C) 2006 Apple Computer, Inc |
6 * Copyright (C) 2009 Google, Inc. | 6 * Copyright (C) 2009 Google, Inc. |
7 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> | 7 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> |
8 * Copyright (C) 2011 University of Szeged | 8 * Copyright (C) 2011 University of Szeged |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 virtual FloatRect objectBoundingBox() const override final { return m_fillBo
undingBox; } | 80 virtual FloatRect objectBoundingBox() const override final { return m_fillBo
undingBox; } |
81 | 81 |
82 virtual const char* name() const override { return "LayoutSVGShape"; } | 82 virtual const char* name() const override { return "LayoutSVGShape"; } |
83 | 83 |
84 protected: | 84 protected: |
85 void clearPath() { m_path.clear(); } | 85 void clearPath() { m_path.clear(); } |
86 void createPath(); | 86 void createPath(); |
87 | 87 |
88 virtual void updateShapeFromElement(); | 88 virtual void updateShapeFromElement(); |
| 89 // Calculates an inclusive bounding box of this shape as if this shape has |
| 90 // a stroke. If this shape has a stroke, then m_strokeBoundingBox is returne
d; |
| 91 // otherwise, estimates a bounding box (not necessarily tight) that would |
| 92 // include this shape's stroke bounding box if it had a stroke. |
| 93 virtual FloatRect hitTestStrokeBoundingBox() const; |
89 virtual bool shapeDependentStrokeContains(const FloatPoint&); | 94 virtual bool shapeDependentStrokeContains(const FloatPoint&); |
90 virtual bool shapeDependentFillContains(const FloatPoint&, const WindRule) c
onst; | 95 virtual bool shapeDependentFillContains(const FloatPoint&, const WindRule) c
onst; |
91 | 96 |
92 FloatRect m_fillBoundingBox; | 97 FloatRect m_fillBoundingBox; |
93 FloatRect m_strokeBoundingBox; | 98 FloatRect m_strokeBoundingBox; |
94 | 99 |
95 private: | 100 private: |
96 // Hit-detection separated for the fill and the stroke | 101 // Hit-detection separated for the fill and the stroke |
97 bool fillContains(const FloatPoint&, bool requiresFill = true, const WindRul
e fillRule = RULE_NONZERO); | 102 bool fillContains(const FloatPoint&, bool requiresFill = true, const WindRul
e fillRule = RULE_NONZERO); |
98 bool strokeContains(const FloatPoint&, bool requiresStroke = true); | 103 bool strokeContains(const FloatPoint&, bool requiresStroke = true); |
(...skipping 20 matching lines...) Expand all Loading... |
119 bool m_needsBoundariesUpdate : 1; | 124 bool m_needsBoundariesUpdate : 1; |
120 bool m_needsShapeUpdate : 1; | 125 bool m_needsShapeUpdate : 1; |
121 bool m_needsTransformUpdate : 1; | 126 bool m_needsTransformUpdate : 1; |
122 }; | 127 }; |
123 | 128 |
124 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGShape, isSVGShape()); | 129 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGShape, isSVGShape()); |
125 | 130 |
126 } | 131 } |
127 | 132 |
128 #endif | 133 #endif |
OLD | NEW |