title: resize svg image in java
body: <p>I'm facing a small but annoying issue. I have an svg image, say "test.svg". I display it with a special Swing component (SVGPanel from SVGSalamander if you're interested, but it doesn't matter). So, <strong>I have my "test.svg" perfectly displayed</strong>, I can also resize it as I wish. Now, my issue is that when I resize my swing component, <strong>I would like to modify the size of "test.svg"</strong>.</p>
  
  <p>My first intent was to modify the width and height attributes of the <code>&lt;svg&gt;</code> element, but of course it doesn't work as expected, because the coordinates of the objects become wrong.</p>
  
  <p>For instance, if I have an horizontal line in the middle of a svg panel :</p>
  
  <pre><code>    //Should be sth like that
      &lt;svg ... height='20' width='20'&gt;&lt;line x1="0" x2="20" y1="10" y2="10" /&gt;&lt;/svg&gt;
  </code></pre>
  
  <p>If I try to resize it by changing only the size, I will get :</p>
  
  <pre><code>    //using my "naive" resize method
      &lt;svg ... height='10' width='10'&gt;&lt;line x1="0" x2="20" y1="10" y2="10" /&gt;&lt;/svg&gt;
  </code></pre>
  
  <p>and the line is not anymore in the middle of the panel. Instead, it is now on the bottom.</p>
  
  <p>All of this is probably very obvious. Sorry if it's the case.</p>
  
  <p>So, in brief, <strong>how can I get the expected result</strong> :</p>
  
  <pre><code>    &lt;svg ... height='10' width='10'&gt;&lt;line x1="0" x2="10" y1="5" y2="5" /&gt;&lt;/svg&gt;
  </code></pre>
  
  <p>Thanks a lot for your help !</p>