soehler / androidsvg

Automatically exported from code.google.com/p/androidsvg
0 stars 0 forks source link

New API request (getDocumentAspectRatio) #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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