-
Notifications
You must be signed in to change notification settings - Fork 54
Description
For my project, I am developing a control surface that is a window-filling SVG, with various graphical elements to comprise buttons, and I would like to use filters to indicate the button states as well as for simple decoration. In particular, feDropShadow will be used a lot, but not on the whole image.
I have followed the example on creating a reusable filter, such as:
var filter = new SVG.Filter();
However, when I attach this filter to my main image as well as an element, it affects the whole image...
myImage.filterWith(filter);
myParticularShape.filterWith(filter);
That seems to make sense. But if I only attach it to the elements that I want to affect, it doesn't work, because the filter information doesn't show up in the definitions section of the image. (The individual elements do include references to the filter, but there is no definition.)
Is there a way to define the filter in the SVG without using it except on particular elements?
(And to kill two birds with one stone, if your response includes an example of invoking feDropShadow on a cricle, while still preserving the appearance of the circle itself, that would really help me out.)