Yes the getBoundingBox does not works. The ellipse below was rotated 12 degrees, if u rotate it 45 degrees then the bounding box is no longer a tight bounding. Is there anywork around / algo for calculating the bounding box of a rotated ellipse correctly.
Regards Faisal Javeed INTECH Process Automation Pvt. Ltd. 119-B Tech Society Lahore-54590, Pakistan Cell: 03334241582 Voice: +92 42 5427001 (3 lines) Fax: +92 42 5411724 Web: www.intechww.com Holger Will <[EMAIL PROTECTED]> Sent by: [email protected] 08/15/2005 04:10 PM Please respond to [email protected] To [email protected] cc Subject Re: [svg-developers] How to calculate Bounding box of a rotated ellipse 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 ----- 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 Visit your group "svg-developers" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h4b6e5h/M=362329.6886308.7839368.1510227/D=groups/S=1706030389:TM/Y=YAHOO/EXP=1124113916/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992 ">Fair play? Video games influencing politics. Click and talk back!</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/

