Skip to content

The matrixify function transform.js does not accept whitespace between name of the transform and '(' #1333

@topox

Description

@topox

Hi,
I used draggable.svg on an SVG which contained an element

which works fine displaying. In draggable.svg the method matrixify from src/modules/optional/transform.js is called and the browser emits
"matrix[transform[0]]" at "transform.js:33" is undefined.

The problem is that
transform[0] == "translate "
i.e. it includes the space at the end, which results in the lookup of
matrix["translate "]
which is undefined.

One temporary fix is to remove the space from the svg file - but it seems to be valid svg (as far as I can tell).

To fix it in the source I would recommend

transform.js:21
- kv[0],
+ kv[0].trim(),

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions