Skip to content
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

Commit ea817cf

Browse files
committed
Add other overload to set attributes (line cap, unit type, extend mode, aspect ratio preserve and length)
1 parent 8b832e4 commit ea817cf

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

Source/SharpDX.Direct2D1/SvgElement.cs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,18 @@ public unsafe void SetAttributeValue(string name, SvgLineJoin lineJoin)
105105
SetAttributeValue(name, SvgAttributePodType.LineJoin, new IntPtr(&lineJoin), sizeof(SvgLineJoin));
106106
}
107107

108+
109+
/// <summary>
110+
/// Sets line cap attribute
111+
/// </summary>
112+
/// <param name="name">Attribute name</param>
113+
/// <param name="lineCap">New svg line cap</param>
114+
public unsafe void SetAttributeValue(string name, SvgLineCap lineCap)
115+
{
116+
SetAttributeValue(name, SvgAttributePodType.LineCap, new IntPtr(&lineCap), sizeof(SvgLineCap));
117+
}
118+
119+
108120
/// <summary>
109121
/// Sets visibility attribute
110122
/// </summary>
@@ -124,5 +136,46 @@ public unsafe void SetAttributeValue(string name, RawMatrix3x2 matrix)
124136
{
125137
SetAttributeValue(name, SvgAttributePodType.Visibility, new IntPtr(&matrix), sizeof(RawMatrix3x2));
126138
}
139+
140+
/// <summary>
141+
/// Sets unit type attribute
142+
/// </summary>
143+
/// <param name="name">Attribute name</param>
144+
/// <param name="unitType">New unit type</param>
145+
public unsafe void SetAttributeValue(string name, SvgUnitType unitType)
146+
{
147+
SetAttributeValue(name, SvgAttributePodType.UnitType, new IntPtr(&unitType), sizeof(SvgUnitType));
148+
}
149+
150+
151+
/// <summary>
152+
/// Sets extend mode attribute
153+
/// </summary>
154+
/// <param name="name">Attribute name</param>
155+
/// <param name="extendMode">New extend mode</param>
156+
public unsafe void SetAttributeValue(string name, ExtendMode extendMode)
157+
{
158+
SetAttributeValue(name, SvgAttributePodType.ExtendMode, new IntPtr(&extendMode), sizeof(ExtendMode));
159+
}
160+
161+
/// <summary>
162+
/// Sets preserve Aspect Ratio attribute
163+
/// </summary>
164+
/// <param name="name">Attribute name</param>
165+
/// <param name="preserveAspectRatio">preserve Aspect Ratio/param>
166+
public unsafe void SetAttributeValue(string name, SvgPreserveAspectRatio preserveAspectRatio)
167+
{
168+
SetAttributeValue(name, SvgAttributePodType.PreserveAspectRatio, new IntPtr(&preserveAspectRatio), sizeof(SvgPreserveAspectRatio));
169+
}
170+
171+
/// <summary>
172+
/// Sets length attribute
173+
/// </summary>
174+
/// <param name="name">Attribute name</param>
175+
/// <param name="length">New length</param>
176+
public unsafe void SetAttributeValue(string name, SvgLength length)
177+
{
178+
SetAttributeValue(name, SvgAttributePodType.Length, new IntPtr(&length), sizeof(SvgLength));
179+
}
127180
}
128181
}

0 commit comments

Comments
 (0)