I'm trying to add a shadow to my SVG. It works well with all 2D objects, but when same filter is applied to a straight line (either <line>
or <path>
), the line becomes invisible, and no shadow is added.
Asked
Active
Viewed 1,237 times
6

Robert Longson
- 118,664
- 26
- 252
- 242

eagor
- 9,150
- 8
- 47
- 50
1 Answers
4
Per the last paragraph here
Keyword objectBoundingBox should not be used when the geometry of the applicable element has no width or no height, such as the case of a horizontal or vertical line, even when the line has actual thickness when viewed due to having a non-zero stroke width since stroke width is ignored for bounding box calculations. When the geometry of the applicable element has no width or height and objectBoundingBox is specified, then the given effect (e.g., a gradient or a filter) will be ignored.

Robert Longson
- 118,664
- 26
- 252
- 242
-
10will fix it – Michael Mullany Mar 29 '16 at 15:13
-
1works perfectly, wondering why cant this treated as the answer? – Anoop Isaac Nov 14 '18 at 16:29