mohadian / androidsvg

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

Image with negative coordinates in svg viewbox are truncated. #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
SVG svg = SVG.getFromResource(this, R.raw.harley);
Picture p = svg.renderToPicture();
Drawable drawable = new PictureDrawable(p);
imageView.setImageDrawable(drawable);

What is the expected output? What do you see instead?
Image with negative coordinates in svg viewbox are truncated.

What version of the product are you using? On what operating system?
1.1.182

Please provide any additional information below.

Original issue reported on code.google.com by hadrien....@gmail.com on 8 Jul 2013 at 10:48

Attachments:

GoogleCodeExporter commented 8 years ago
Hi. Thanks for the bug report.

Are you able to post a screenshot of what is happening please?

What are the dimensions of the ImageView you are using for the SVG?  Is it a 
specific size, or are you using MATCH_PARENT etc?

Original comment by paul.leb...@gmail.com on 9 Jul 2013 at 5:35

GoogleCodeExporter commented 8 years ago
Here is my complete code : 

public class MainActivity extends Activity
{

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        LinearLayout layout = new LinearLayout(this);
        ImageView imageView = new ImageView(this);
        imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
        SVG svg = null;
        try
        {
            svg = SVG.getFromResource(this, R.raw.harley);
            Drawable drawable = new PictureDrawable(svg.renderToPicture());
            imageView.setImageDrawable(drawable);
        }
        catch(SVGParseException e)
        {}
        layout.addView(imageView, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
        setContentView(layout);
    }

}

Original comment by hadrien....@gmail.com on 9 Jul 2013 at 3:52

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the additional info.

Original comment by paul.leb...@gmail.com on 9 Jul 2013 at 4:40

GoogleCodeExporter commented 8 years ago
I just tested this against my current development branch and it turns out this 
renders correctly.  So it looks like one of my other recent fixes resolved this 
issue.  The next release of AndroidSVG is coming soon.

I am closing this issue for now. If it is still happening after the next 
release (1.2) please let me know.

Original comment by paul.leb...@gmail.com on 9 Jul 2013 at 4:50

GoogleCodeExporter commented 8 years ago
Version 1.2.0 has now been released. Please try this new version and let me 
know if your issue has been resolved. Thanks.

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