@@ -53,6 +53,27 @@ public SvgGraphics(Color backgroundColor) {
5353 _transforms = new MatrixStack ( ) ;
5454 }
5555
56+ /// <summary>
57+ /// Get a string containing an SVG document. The very heart of SvgGdi. It calls <c>WriteSVGString</c> on the <see cref="SvgElement"/>
58+ /// at the root of this <c>SvgGraphics</c> and returns the resulting string.
59+ /// </summary>
60+ public string WriteSVGString ( ) => _root . WriteSVGString ( true ) ;
61+
62+ /// <summary>
63+ /// Get a string containing an SVG document. The very heart of SvgGdi. It calls <c>WriteSVGString</c> on the <see cref="SvgElement"/>
64+ /// at the root of this <c>SvgGraphics</c> and returns the resulting string.
65+ /// </summary>
66+ /// <param name="bounds">Width/Height values to add as attributes to the svg element</param>
67+ public string WriteSVGString ( SizeF bounds ) => _root . WriteSVGString ( true , bounds ) ;
68+
69+ /// <summary>
70+ /// Get a string containing an SVG document. The very heart of SvgGdi. It calls <c>WriteSVGString</c> on the <see cref="SvgElement"/>
71+ /// at the root of this <c>SvgGraphics</c> and returns the resulting string.
72+ /// </summary>
73+ /// <param name="width">Width value to add as attribute to the svg element</param>
74+ /// <param name="height">Height value to add as attribute to the svg element</param>
75+ public string WriteSVGString ( float width , float height ) => _root . WriteSVGString ( true , new SizeF ( width , height ) ) ;
76+
5677 /// <summary>
5778 /// Not implemented.
5879 /// </summary>
@@ -1365,12 +1386,6 @@ public void SetClip(RectangleF rect) {
13651386 /// </summary>
13661387 public void TranslateTransform ( float dx , float dy , MatrixOrder order ) => _transforms . Top . Translate ( dx , dy , order ) ;
13671388
1368- /// <summary>
1369- /// Get a string containing an SVG document. The very heart of SvgGdi. It calls <c>WriteSVGString</c> on the <see cref="SvgElement"/>
1370- /// at the root of this <c>SvgGraphics</c> and returns the resulting string.
1371- /// </summary>
1372- public string WriteSVGString ( ) => _root . WriteSVGString ( true ) ;
1373-
13741389 //a default graphics so that we can make a guess as to functions like MeasureString
13751390 private static Graphics _g ;
13761391 private readonly SvgRectElement _bg ;
@@ -1753,11 +1768,13 @@ private static string GDIArc2SVGPath(float x, float y, float width, float height
17531768
17541769 sweepAngle += startAngle ;
17551770
1771+ #pragma warning disable IDE0180
17561772 if ( sweepAngle > startAngle ) {
1757- var temp = startAngle ;
1773+ float temp = startAngle ;
17581774 startAngle = sweepAngle ;
17591775 sweepAngle = temp ;
17601776 }
1777+ #pragma warning restore IDE0180
17611778
17621779 if ( sweepAngle - startAngle > Math . PI || startAngle - sweepAngle > Math . PI ) longArc = 1 ;
17631780
0 commit comments