Faisal Javeed schrieb:

> I want to calculate the bounding box of an ellipse rotated at some angle.
> How can i do that. Since the ellipse is rotated so the values of rx 
> and ry
> will not be along the screen x/y axis but along the rotated x and y axis
> of ellipse. So using these to calculated the bounding box introduces and
> error margin.
>
> I tried the getBoundingBox method of svg but it also has this error.
> Returns invalid bounding box for a rotated ellipse.


this must be a bug in ASV since it it seems to work correctly in batik 
and mozilla. here is a simple testcase:
(click on the ellipse to see the boundingbox !)

<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg";
 xmlns:xlink="http://www.w3.org/1999/xlink"; viewBox="0 0 1024 768" 
onclick="init()">
<script>
function init(){
re=document.getElementById("re")
box=document.getElementById("e").getBBox()
re.setAttribute("x",box.x)
re.setAttribute("y",box.y)
re.setAttribute("width",box.width)
re.setAttribute("height",box.height)
}
</script>
<g id="e">
<ellipse cx="50" cy="50" rx="50" ry="20" transform="rotate(12)"/>
</g>
<rect id="re" x="0" y="0" width="100" height="100" fill="none" 
stroke="red"/>
</svg>


cheers
Holger


------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hli1gas/M=362335.6886445.7839731.1510227/D=groups/S=1706030389:TM/Y=YAHOO/EXP=1124111489/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/";>In
 low income neighborhoods, 84% do not own computers. At Network for Good, help 
bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~-> 

-----
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