Skip to content

Negative viewbox values are not respected #101

Open
@mlaggner

Description

@mlaggner

If you use a SVG image with negative viewbox values, the rendered image is not aligned in the same way the SVG is.

Take the checkmark of FontAwesome for example:

<svg xmlns="http://www.w3.org/2000/svg"
     viewBox="-96 0 512 512">
    <path d="M312.1 375c9.369 9.369 9.369 24.57 0 33.94s-24.57 9.369-33.94 0L160 289.9l-119 119c-9.369 9.369-24.57 9.369-33.94 0s-9.369-24.57 0-33.94L126.1 256L7.027 136.1c-9.369-9.369-9.369-24.57 0-33.94s24.57-9.369 33.94 0L160 222.1l119-119c9.369-9.369 24.57-9.369 33.94 0s9.369 24.57 0 33.94L193.9 256L312.1 375z"/>
</svg>

this icon is centered if you view it directly (image editor, browser, ...), but if you render it to e.g. 15x15 with svgSalamander, the icon is left aligned (if the viewbox x value would be zero)

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