Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New API request (getDocumentAspectRatio) #5

Closed
GoogleCodeExporter opened this issue Jul 24, 2015 · 2 comments
Closed

New API request (getDocumentAspectRatio) #5

GoogleCodeExporter opened this issue Jul 24, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Sometime the SVG document dimensions are expressed as percentages and not 
returned by getDocumentWidth/Height. Nevertheless it would be useful to know at 
least the aspect ratio of the document in order to select the optimum 
dimensions for a bitmap to host the SVG. 
I would propose to introduce a new API like this:

   public float  getDocumentAspectRatio()
   {
       if (this.rootElement == null)
           return 1.0f;

       Length  w = this.rootElement.width;
       Length  h = this.rootElement.height;

       return w.value/h.value;
   }

Original issue reported on code.google.com by a.diba...@gmail.com on 5 Jun 2013 at 4:19

@GoogleCodeExporter
Copy link
Author

Fixed in revision 197.

Added a new API call SVG.getDocumentAspectRatio().  This new method will be 
available in the next release.

Marking: Fixed.

Original comment by paul.leb...@gmail.com on 17 Jun 2013 at 8:57

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Version 1.2.0 has now been released. It includes the new API method you 
requested. Thanks for the suggestion.

Original comment by paul.leb...@gmail.com on 16 Jul 2013 at 3:23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant