Skip to content

Bare :close in path drops following element #22

@cursive-ghost

Description

@cursive-ghost

If I have the following path (trimmed for succinctness from a real one):

(dali/render-svg-string
  [:dali/page
   [:path
    :move-to
    [2.23828125 0.0]
    :line-to
    [2.23828125 -17.34375]
    :close
    :move-to
    [4.67578125 -8.75390625]
    :line-to
    [5.671875 -8.75390625]
    :close]])
=>
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
 <svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.2\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"15.671875\" height=\"10.0\"><path d=\"M 2.23828125 0.0 L 2.23828125 -17.34375 Z L 5.671875 -8.75390625 Z\"></path></svg>"

Notice how the generated path does not include the second :move-to. If I do the following, then it works:

(dali/render-svg-string
  [:dali/page
   [:path
    :move-to
    [2.23828125 0.0]
    :line-to
    [2.23828125 -17.34375]
    :close
    []
    :move-to
    [4.67578125 -8.75390625]
    :line-to
    [5.671875 -8.75390625]
    :close]])
=>
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
 <svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.2\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"15.671875\" height=\"10.0\"><path d=\"M 2.23828125 0.0 L 2.23828125 -17.34375 Z M 4.67578125 -8.75390625 L 5.671875 -8.75390625 Z\"></path></svg>"

Oddly, replacing the bare [] with nil doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions