Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser won't parse filter attributes of the effects nodes. #8

Open
joseedil opened this issue Sep 25, 2020 · 1 comment
Open

Parser won't parse filter attributes of the effects nodes. #8

joseedil opened this issue Sep 25, 2020 · 1 comment

Comments

@joseedil
Copy link
Collaborator

Filter attributes (height, result, width, x, y) are not parsed for filter elements. Take for example the attached SVG in which the feFlood and feOffset have specific width and height parameters.

I unsuccessfully tried tweaking the XMLUpdatable instance for the FilterElement data type.
The only way a could solve it was by extending the attributes element for each individual filter element XMLUpdatable instance like so

instance XMLUpdatable Flood where
  xmlTagName _ = "feFlood"
  serializeTreeNode = genericSerializeWithDrawAttr
  attributes =
    [ "width" `parseIn` (filterAttributes . filterWidth)
    , "height" `parseIn` (filterAttributes . filterHeight)
    , "x" `parseIn` (filterAttributes . filterX)
    , "y" `parseIn` (filterAttributes . filterY)
    , "flood-color" `parseIn` floodColor
    , "flood-opacity" `parseIn` floodOpacity]

but I believe there must be a more generic way of solving it.

filters-tile-01-b.svg.txt
filter-tile-01-v.dump.txt

@lemmih
Copy link
Member

lemmih commented Oct 9, 2020

I think I partially fixed this. At least for the 'result' attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants