This project is read-only.
1
Vote

Bug in v2.1 Render Issue

description

On bottom you see the Bug. The Application was the "SVGViewer" - Sample. I have also attached the SVG File.

Regards
Dojo90

Version 2.0
Image

Version 2.1
Image
                SvgDocument svgDoc = SvgDocument.Open(openSvgFile.FileName);
                svgDoc.Transforms = new SvgTransformCollection();
                svgDoc.Transforms.Add(new SvgScale(2, 2));
                svgDoc.Width = new SvgUnit(svgDoc.Width.Type, svgDoc.Width * 2);
                svgDoc.Height = new SvgUnit(svgDoc.Height.Type, svgDoc.Height * 2);
                svgImage.Image = svgDoc.Draw();

file attachments

comments

dojo90 wrote May 10, 2016 at 10:30 AM

You have to recompile the DLL yourself and do not use the NuGet DLL.

There is also a convert Bug. Here I wrote a Extension.
        private static SvgUnit Bugfix(this SvgUnit value)
        {
            float tempFloat;

            switch (value.Type)
            {
                case SvgUnitType.Point:
                    tempFloat = value.Value * 1.25f;
                    break;

                case SvgUnitType.Pica:
                    tempFloat = value.Value * 15.0f;
                    break;

                case SvgUnitType.Millimeter:
                    tempFloat = value.Value * 3.543307f;
                    break;

                case SvgUnitType.Centimeter:
                    tempFloat = value.Value * 35.43307f;
                    break;

                case SvgUnitType.Inch:
                    tempFloat = value.Value * 90.0f;
                    break;

                case SvgUnitType.User:
                case SvgUnitType.Pixel:
                    tempFloat = value.Value;
                    break;

                default:
                    tempFloat = value.Value;
                    MessageBox.Show("Format not supported!");
                    break;
            }

            return new SvgUnit(SvgUnitType.Pixel, tempFloat);
        }