BerndK / SvgToXaml

Smart Tool to view svg-files and convert them to xaml for use in .NET
Other
886 stars 164 forks source link

Change SharpVectors nuget (dead project) to SharpVectors.Reloaded #14

Closed Casimir666 closed 5 years ago

Casimir666 commented 5 years ago

Since initial SharpVectors is not maintained anymore, I have update the project to use SharpVectors.Reloaded nuget instead. I have also add some unneeded stuff in .gitignore

BerndK commented 5 years ago

Hi Casimir666, yes you are right, packages can also be restored automatically. It was a design desicion to provide the packages in the project. If you have lot's of updates of the packages, storing them is silly, but as you see there are no/few changes only. The size of the whole zip is ~6MB which is also tolerable. More important is the fact, that I didd some changes to the original packages, so it was a must to provide them binary. As I did not check if the latest packages you use did also contain these workarounds!? So what was the primary reason of you changes. I did not see any functional changes? So for me there is currently no need to change a tested version. Regards, Bernd.

Casimir666 commented 5 years ago

He Bernd, I underderstand the reason you provide the package in the project, especially for "BKEDV.CommandLineParser" because it have been removed from Nuget!

The reason I've updated your project it's because conversion has failed with this SVG : sablier.zip

` 'Ecran_d'attente' is not a valid value for property 'Name'.

at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) at SharpVectors.Renderers.Wpf.WpfGroupRendering.BeforeRender(WpfDrawingRenderer renderer) at SharpVectors.Renderers.Wpf.WpfRenderingHelper.RenderElement(ISvgElement svgElement) at SharpVectors.Renderers.Wpf.WpfRenderingHelper.RenderElementChildren(ISvgElement svgElement) at SharpVectors.Renderers.Wpf.WpfRenderingHelper.RenderElement(ISvgElement svgElement) at SharpVectors.Renderers.Wpf.WpfRenderingHelper.RenderElementChildren(ISvgElement svgElement) at SharpVectors.Renderers.Wpf.WpfRenderingHelper.RenderElement(ISvgElement svgElement) at SharpVectors.Renderers.Wpf.WpfRenderingHelper.Render(ISvgDocument docElement) at SharpVectors.Renderers.Wpf.WpfDrawingRenderer.Render(ISvgDocument node) at SharpVectors.Converters.FileSvgReader.LoadFile(Stream stream) at SvgConverter.ConverterLogic.SvgFileToWpfObject(String filepath, WpfDrawingSettings wpfDrawingSettings) in C:\Data\Downloads\SvgToXaml\SvgConverter\ConverterLogic.cs:line 358 at SvgConverter.ConverterLogic.ConvertFileToDrawingGroup(String filepath, WpfDrawingSettings wpfDrawingSettings) in C:\Data\Downloads\SvgToXaml\SvgConverter\ConverterLogic.cs:line 267 at SvgConverter.ConverterLogic.ConvertSvgToObject(String filepath, ResultMode resultMode, WpfDrawingSettings wpfDrawingSettings, String& name, ResKeyInfo resKeyInfo) in C:\Data\Downloads\SvgToXaml\SvgConverter\ConverterLogic.cs:line 59 at SvgConverter.ConvertedSvgData.get_ConvertedObj() in C:\Data\Downloads\SvgToXaml\SvgConverter\ConvertedSvgData.cs:line 38 at SvgToXaml.ViewModels.SvgImageViewModel.GetImageSource() in C:\Data\Downloads\SvgToXaml\SvgToXaml\ViewModels\SvgImageViewModel.cs:line 35 at SvgToXaml.ViewModels.ImageBaseViewModel.get_PreviewSource() in C:\Data\Downloads\SvgToXaml\SvgToXaml\ViewModels\ImageBaseViewModel.cs:line 20`

This bug have been fixed in "SharpVectors.Reloaded".

Regards, Casimir

BerndK commented 5 years ago

Hi Casimir,

right this is the correct approach, report a bug and then let's see how to resolve it. I will have a look into that. Now there is a good reason to consider using the new libs, so I will check, if my prior changes/fixes have also been fixed now. I hope that I will find some time soon. Regards, Bernd.

BerndK commented 5 years ago

Hi Casimir, I added unit tests for the 'old' implementation. Then I converted to SharpVectors.Reloaded 1.2.0 Now the output looks really different, please check the branch I added and check the folders Expected and Actual below the TestFiles when running the unit tests. If we want to accept the 'new' format, we can copy the actual files to the expected ones. Please give some feedback. Cheers, Bernd.

Casimir666 commented 5 years ago

He Bernd, Thanks you for having taking time to solve my problem. You are right the Xaml generated is different, "actual" and "expected" are identical on screen. So I think it's acceptable to replace "expected" with "actual"

Cheers, Casimir

BerndK commented 5 years ago

updated project to use new version of ShaprVectors.Reloaded

Casimir666 commented 5 years ago

Thanks you very much Bernd.