Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Elements not visible with 'defs' / 'use' #23

Open
pedro-w opened this issue Dec 6, 2016 · 3 comments
Open

Elements not visible with 'defs' / 'use' #23

pedro-w opened this issue Dec 6, 2016 · 3 comments
Labels

Comments

@pedro-w
Copy link

pedro-w commented Dec 6, 2016

Elements which are defined in a defs section and then subsequently referenced by a use element are not shown. See example file. I would expect the box to be visible (as it is when loaded with Edge or with Atom's SVG preview).
Using VSCode 1.7.2, SVG viewer 1.2.0.

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" 
    width="128" height="128" 
    xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<g id="box">
<rect height="20" width="20" 
    stroke="black" fill="white"/>
</g>
</defs>
<use xlink:href="#box" x="50" y="50"/>
</svg>

vscode
atom

@cssho
Copy link
Owner

cssho commented Dec 15, 2016

Thanx @pedro-w
Fixed this issue with v1.3.0

@cssho cssho closed this as completed Dec 15, 2016
@cimbul
Copy link

cimbul commented Dec 29, 2016

I'm still seeing this with v1.3.0, on VSCode 1.7.2 and macOS 10.11.6, using the exact SVG given by the OP. The same problem exists with <symbol> + <use>.

@cssho cssho reopened this Jan 1, 2017
@fvsch
Copy link

fvsch commented Jun 23, 2017

Works for me with 1.4.2 on VSCode 1.13.1 on macOS.

Example from OP: displays alright.
Another example that works:

<svg xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  viewBox="0 0 100 100">
  <rect id="foo" x="0" y="0" width="50" height="50" fill="red"></rect>
  <use xlink:href="#foo" x="50" y="50"></use>
</svg>

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

No branches or pull requests

4 participants