Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Source/DataTypes/SvgAspectRatio.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using Svg.DataTypes;

namespace Svg
Expand Down Expand Up @@ -54,6 +55,11 @@ public object Clone()
return MemberwiseClone();
}

#if NET6_0_OR_GREATER
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(SvgPreserveAspectRatioConverter))]
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "DynamicDependency keeps converter safe")]
[UnconditionalSuppressMessage("AOT", "IL3050")]
#endif
public override string ToString()
{
return TypeDescriptor.GetConverter(typeof(SvgPreserveAspectRatio)).ConvertToString(this.Align) + (Slice ? " slice" : "");
Expand Down
10 changes: 8 additions & 2 deletions Source/DataTypes/SvgPoint.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using Svg.DataTypes;

namespace Svg
{
Expand Down Expand Up @@ -39,12 +41,16 @@ public override int GetHashCode()
return base.GetHashCode();
}

#if NET6_0_OR_GREATER
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(SvgUnitConverter))]
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "DynamicDependency keeps converter safe")]
#endif
public SvgPoint(string x, string y)
{
TypeConverter converter = TypeDescriptor.GetConverter(typeof(SvgUnit));

this.x = (SvgUnit)converter.ConvertFrom(x);
this.y = (SvgUnit)converter.ConvertFrom(y);
this.x = (SvgUnit)converter.ConvertFrom(x)!;
this.y = (SvgUnit)converter.ConvertFrom(y)!;
}

public SvgPoint(SvgUnit x, SvgUnit y)
Expand Down