Re: Specyfing paths with percentages unit.

Cameron McCormack <[email protected]>
Newsgroups gmane.comp.mozilla.devel.svg
Message-ID <[email protected]>
Hi Kamil.

Kamil Trebunia / ffreak wrote:
> I've got a question with probably obvious answer, but I can't find
> it...
> 
> I want to draw a simple path, but using percentages as units.
> 
> I've got svg element of 380x190 size. And I've got path like this one:

As Helder says, you cannot use percentages in path data.  You can work
around this by creating a coordinate system where the units correspond
to percentage values.  Basically you do:

  <svg width='100%' height='100%' viewBox='0 0 100 100'>
    <!-- Now in here, a coordinate (25,50) corresponds to
         (25%,50%) of the outer viewport. -->
    <path d="M36,96 C 54,100 94,73 97,61 ..."/>
  </svg>

-- 
Cameron McCormack ≝ http://mcc.id.au/
_______________________________________________
dev-tech-svg mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-svg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.