blackears / svgSalamander

155 stars 56 forks source link

Y offset of nested SVG not taken into account #31

Closed don-vip closed 5 years ago

don-vip commented 5 years ago

When loading the attached SVG file svg_bug_30.zip we face the following display error (after I fixed #29):

svg_bug

The expected display is: expected

The SVG is defined as follows:

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="300" height="480" viewBox="0 0 300 480">
    <rect x="140" y="0" width="20" style="fill:#f5f5f5;stroke:#000000;" id="pole" height="480"/>
    <svg version="1.1" id="Nederlands_verkeersbord_C3" height="300" width="300" viewBox="0 0 300 300" y="10" preserveAspectRatio="xMidYMid meet">
        <g>
                    <!-- -->
        </g>
    </svg>
    <svg version="1.1" id="Nederlands_verkeersbord_OB54" height="150" width="300" viewBox="0 0 300 150" y="310" preserveAspectRatio="xMidYMid meet">
        <g>
                    <!-- -->
        </g>
    </svg>
</svg>

It seems the y=10 and y=310 attributes of nested svg elements are not taken into account.