>>Thanks for you assistance. Tried both "xMinYMin" and "none" both 
before and
 >>after the height/width adjustments and appears to have no effect.

well, sorry i totally forgot... preserveAspectRatio has only an effect 
if you have a viewBox.
and the AspectRation of your viewBox is different to the aspectRatio set 
by width and height.

here is a little example that works for me:

<svg xmlns="http://www.w3.org/2000/svg";>
<rect x="0" y="0" width="100" height="100" rx="10" ry="10" 
onclick="test()"/>
<script><![CDATA[
function test(){

// setting width/height different to the boundidng box of your drawing
document.documentElement.setAttributeNS(null,"width",100)
document.documentElement.setAttributeNS(null,"height",200)

// setting viewBox to the dimension of our drawing.
document.documentElement.setAttributeNS(null,"viewBox","0 0 100 100")

document.documentElement.setAttributeNS(null,"preserveAspectRatio","none")

}
]]></script>
</svg>

as to calculating the space, it should not be necessary to calculate it, 
but if you really want to...:

the height of our svg is larger than the height of the viewBox. so the 
image gets scaled to exactly fit the width.
after saling ( in this example the scalefactor is 1) the difference 
between width and viewBox width is exactly 100.
as the default for preserveAspectRatio is xMidYMid, you have the same 
space above and below the drawing, thats 100/2 = 50.
so currentTramslate.y - 50 should have the same effect as setting 
preserveAspectRation ="xMidYMin meet", but again it should not be 
necessary to do this.

if all that does not help, maybe you could write a little testcase 
and/or provide a link, so i can take a look at your code, it might be 
possible to help more.

cheers
Holger

-- 
if this information was useful, please try to help someone else !
My Private Homepage: http://www.treebuilder.de
My Companys Website: http://www.klimapartner-berlin.de



------------------------ Yahoo! Groups Sponsor --------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/1U_rlB/TM
--------------------------------------------------------------------~-> 

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to