navneet-nmk / svg-android

Automatically exported from code.google.com/p/svg-android
0 stars 0 forks source link

Error in bounds calculation in SVGHandler.startElement #10

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. using a bounds layer where the width is not equal to the height

What version of the product are you using? On what operating system?
r44 of SVGParser.java

Please provide any additional information below.
            if (boundsMode) {
                if (localName.equals("rect")) {
                    Float x = getFloatAttr("x", atts);
                    if (x == null) {
                        x = 0f;
                    }
                    Float y = getFloatAttr("y", atts);
                    if (y == null) {
                        y = 0f;
                    }
                    Float width = getFloatAttr("width", atts);
                    Float height = getFloatAttr("height", atts);
                    bounds = new RectF(x, y, x + width, y + width);
                }
                return;
            }

as you can see in the line bounds = new RectF(x, y, x + width, y + width), the 
width is being added to y instead of height.

it should be bounds = new RectF(x, y, x + width, y + height);

Original issue reported on code.google.com by clarkd...@gmail.com on 10 Aug 2011 at 6:45

GoogleCodeExporter commented 8 years ago
issue 6 contains a patch for this.

Original comment by mccor...@gmail.com on 1 Sep 2011 at 2:32