tangxu
2024-10-24 3024f6d3d1618d8e90082f5aec0cc1bb6fabeea6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// THIS FILE IS PART OF SVG PROJECT
// THE SVG PROJECT IS AN OPENSOURCE LIBRARY LICENSED UNDER THE MS-PL License.
// COPYRIGHT (C) svg-net. ALL RIGHTS RESERVED.
// GITHUB: https://github.com/svg-net/SVG
 
using System.ComponentModel;
 
namespace AntdUI.Svg
{
    /// <summary>
    /// Description of SvgAspectRatio.
    /// </summary>
    public class SvgAspectRatio
    {
        public SvgAspectRatio() : this(SvgPreserveAspectRatio.none)
        {
        }
 
        public SvgAspectRatio(SvgPreserveAspectRatio align)
            : this(align, false)
        {
        }
 
        public SvgAspectRatio(SvgPreserveAspectRatio align, bool slice)
            : this(align, slice, false)
        {
        }
 
        public SvgAspectRatio(SvgPreserveAspectRatio align, bool slice, bool defer)
        {
            Align = align;
            Slice = slice;
            Defer = defer;
        }
 
        public SvgPreserveAspectRatio Align { get; set; }
 
        public bool Slice { get; set; }
 
        public bool Defer { get; set; }
 
        public override string ToString()
        {
            return TypeDescriptor.GetConverter(typeof(SvgPreserveAspectRatio)).ConvertToString(Align) + (Slice ? " slice" : "");
        }
 
    }
 
    public enum SvgPreserveAspectRatio
    {
        xMidYMid, //default
        none,
        xMinYMin,
        xMidYMin,
        xMaxYMin,
        xMinYMid,
        xMaxYMid,
        xMinYMax,
        xMidYMax,
        xMaxYMax
    }
}