Re: preserveAspectRatio / viewBox

Simon,

On Tue 23 Sep 2003, Shutter, Simon B WLAP:EX wrote:

> I am struggling to understand the concepts of coordinate transformations and
> nested objects.  What I would like to do is create a viewbox that has an
> aspect ratio that is different to the svg width and height but I don't want
> to preserve the aspect ratio.  Inside that viewbox I would like to create
> another element but preserve it aspect ratio.

Well, you can certainly preserve the aspect ratio of 
anything anywhere, but only relative to its parent coordinate
system. In other words, once you've screwed up the ratio,
everything underneath inherits the mess. Unfortunately the
inner element can't tell that its parent has an un-preserved
aspect ration. Does this make sense?

> I'm hoping someone can suggest a best practice for this.

Unless I'm having a bad day and forgetting something, I don't
think there is an easy way. Through scripting you could work
out what the transformations are at any stage down the tree and
then set a viewBox that would work, but that would be a little
tricky.

Dean

Received on Monday, 6 October 2003 11:25:38 UTC