M1cha / androidsvg

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

Incorrect rendering of SVG image #63

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Render the atttached file.

What is the expected output? What do you see instead?
Should be simple menu with 3 horizontal bars but only background.

Original issue reported on code.google.com by jakub.zi...@gmail.com on 15 May 2015 at 12:35

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thanks for the report.

I suspect it is probably the <use> in the <clipPath> that is the problem.  Does 
this version of the file work?

Original comment by paul.leb...@gmail.com on 15 May 2015 at 1:58

Attachments:

GoogleCodeExporter commented 9 years ago
No :/ same problem with your version. Only background is rendered. 

Original comment by jakub.zi...@gmail.com on 15 May 2015 at 2:09

GoogleCodeExporter commented 9 years ago
Ok i find. When i use SVGImageView and define in xml 

    <com.caverock.androidsvg.SVGImageView
        android:id="@+id/menu"
        android:layout_width="40dp"
        android:layout_height="40dp"
        svgimageview:svg="svg/Issue63b.svg" />

it dosn't work but if i load svg using SVG.getFromAsset

SVG svg = SVG.getFromAsset(ctx.getResources().getAssets(), 
SVG_FOLDER_NAME+"/"+name);
ret = Bitmap.createBitmap(width, height, Config.ARGB_8888);
Canvas canvas = new Canvas(ret);
svg.setDocumentHeight(height);
svg.setDocumentWidth(width);
svg.renderToCanvas(canvas);

everything is fine. It does not matter whether I use my or your svg version.

Original comment by jakub.zi...@gmail.com on 15 May 2015 at 2:34

GoogleCodeExporter commented 9 years ago
menuButton = (SVGImageView)findViewById(R.id.menu);
menuButton.setImageAsset("svg/menu.svg");

this way don't work to. 

Original comment by jakub.zi...@gmail.com on 15 May 2015 at 2:43