Commit f9088cab authored by Tebjan Halm's avatar Tebjan Halm
Browse files

fixed circle attributes

parent 7e3424cb
...@@ -17,6 +17,10 @@ namespace Svg ...@@ -17,6 +17,10 @@ namespace Svg
{ {
private GraphicsPath _path; private GraphicsPath _path;
private SvgUnit _radius;
private SvgUnit _centerX;
private SvgUnit _centerY;
/// <summary> /// <summary>
/// Gets the center point of the circle. /// Gets the center point of the circle.
/// </summary> /// </summary>
...@@ -26,58 +30,33 @@ namespace Svg ...@@ -26,58 +30,33 @@ namespace Svg
get { return new SvgPoint(this.CenterX, this.CenterY); } get { return new SvgPoint(this.CenterX, this.CenterY); }
} }
/// <summary>
/// Gets or sets the center X co-ordinate.
/// </summary>
/// <value>The center X.</value>
[SvgAttribute("cx")] [SvgAttribute("cx")]
public SvgUnit CenterX public virtual SvgUnit CenterX
{ {
get { return this.Attributes.GetAttribute<SvgUnit>("cx"); } get { return this._centerX; }
set set
{ {
if (this.Attributes.GetAttribute<SvgUnit>("cx") != value) this._centerX = value;
{
this.Attributes["cx"] = value;
this.IsPathDirty = true; this.IsPathDirty = true;
} }
} }
}
/// <summary>
/// Gets or sets the center Y co-ordinate.
/// </summary>
/// <value>The center Y.</value>
[SvgAttribute("cy")] [SvgAttribute("cy")]
public SvgUnit CenterY public virtual SvgUnit CenterY
{ {
get { return this.Attributes.GetAttribute<SvgUnit>("cy"); } get { return this._centerY; }
set set
{ {
if (this.Attributes.GetAttribute<SvgUnit>("cy") != value) this._centerY = value;
{
this.Attributes["cy"] = value;
this.IsPathDirty = true; this.IsPathDirty = true;
} }
} }
}
/// <summary>
/// Gets or sets the radius of the circle.
/// </summary>
/// <value>The radius.</value>
[SvgAttribute("r")] [SvgAttribute("r")]
public SvgUnit Radius public virtual SvgUnit Radius
{
get { return this.Attributes.GetAttribute<SvgUnit>("r"); }
set
{ {
if (this.Attributes.GetAttribute<SvgUnit>("r") != value) get { return this._radius; }
{ set { this._radius = value; this.IsPathDirty = true; }
this.Attributes["r"] = value;
this.IsPathDirty = true;
}
}
} }
/// <summary> /// <summary>
......
...@@ -22,6 +22,8 @@ namespace Svg ...@@ -22,6 +22,8 @@ namespace Svg
_defaults["clip-rule"] = "nonzero"; _defaults["clip-rule"] = "nonzero";
_defaults["transform"] = ""; _defaults["transform"] = "";
_defaults["rx"] = "0";
_defaults["ry"] = "0";
_defaults["cx"] = "0"; _defaults["cx"] = "0";
_defaults["cy"] = "0"; _defaults["cy"] = "0";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment