svg width height viewport [Archive] - XML Elves

svg width height viewport

surfer97301
08-07-2004, 03:56 PM
Okay so I think I have my previous problem figured out but I am confused with one aspect of <svg width="100%" height="100%" viewport = "0 0 100 100">

I would think this would tell svg that I want the whole screen to be my canvas, so this means that 0,0 = 0,0 and 100,100 on a 1024x768 display means 1024,768 but when I look at the rendering my background which is

<rect fill="grey" stroke="#000000" stroke-width="0" x="0" y="0" width="100" height="100"/>

It is rendered as having an equally sized width and height where as it should be a rectangle with coordinates 0,0 to 1024,768.

What am I missing?

Anonymous
08-08-2004, 12:29 AM
When you use width="100%" and height="100%" with viewBox you have a very important parameter that is preserveAspectRatio.
By default value is "xMidYMid meet", meet say that all your area 100 x 100 is draw using greatest ratio on screen. As your screen is not a square, xMidYMid say that your area is centered so you get some space on right and left.

If you put preserveAspectRatio = "none", your area is on whole screen but you get some deformation ...

With preserveAspectRatio = "xMidYMid slice" your square take all window in width but you don't see all square. You can add by script scrollbar to see all square.

Michel

surfer97301
08-08-2004, 06:26 PM
Perfect, thanks for the clairification! Putting the preserveAspectRatio="none" worked and the svg expands to the dimensions of the resolution.

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum