Skip to content

Commit 8039368

Browse files
committed
Radial gradient defaults
1 parent f210b1a commit 8039368

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Source/SVGImage/SVG/PaintServer/RadialGradientColorPaintServer.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public RadialGradientColorPaintServerPaintServer(PaintServerManager owner, XmlNo
2020
: base(owner, node)
2121
{
2222
System.Diagnostics.Debug.Assert(node.Name == SVGTags.sRadialGradient);
23-
this.CX = XmlUtil.AttrValue(node, "cx", double.NaN);
24-
this.CY = XmlUtil.AttrValue(node, "cy", double.NaN);
25-
this.FX = XmlUtil.AttrValue(node, "fx", double.NaN);
26-
this.FY = XmlUtil.AttrValue(node, "fy", double.NaN);
27-
this.R = XmlUtil.AttrValue(node, "r", double.NaN);
23+
this.CX = XmlUtil.AttrValue(node, "cx", 0.5);
24+
this.CY = XmlUtil.AttrValue(node, "cy", 0.5);
25+
this.FX = XmlUtil.AttrValue(node, "fx", this.CX);
26+
this.FY = XmlUtil.AttrValue(node, "fy", this.CY);
27+
this.R = XmlUtil.AttrValue(node, "r", 0.5);
2828
this.Normalize();
2929
}
3030

@@ -47,6 +47,7 @@ public override Brush GetBrush(double opacity, SVG svg, SVGRender svgRender, Rec
4747

4848
if (this.GradientUnits == SVGTags.sUserSpaceOnUse)
4949
{
50+
5051
b.Center = new System.Windows.Point(this.CX, this.CY);
5152
b.GradientOrigin = new System.Windows.Point(this.FX, this.FY);
5253
b.RadiusX = this.R;

0 commit comments

Comments
 (0)