bumbu/svg-pan-zoom

<use [...] /> is cut off

Open

#52 opened on Jul 24, 2014

View on GitHub
 (11 comments) (0 reactions) (0 assignees)JavaScript (383 forks)batch import
bughelp wanted

Repository metrics

Stars
 (1,585 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

When I use symbols and uses to decrease the size of an svg because I use the same element multiple times I get some issues with svg-pan-zoom:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/2000/svg">
<defs>
  <symbol id="my_id">
    <circle r="10" />
  </symbol>
</defs>
<g>
  <use xlink:href="#my_id"/>
</g>
<g transform="scale(1.5)">
  <use xlink:href="#my_id" x="2000" y="1000" />
</g>

When I use this svg on a screen that has not a height of 100px and a width of 2000px the second element is not visible. In my actual project I have paths that are displayed until the screen ends, but when I pan the svg up the path is cut off.

Contributor guide