Commit 59051383 authored by tebjan's avatar tebjan
Browse files

some OnAttributeChanged events would not be fired, added changed check for some attributes

parent 18ec8075
......@@ -36,27 +36,43 @@ namespace Svg
get { return this._centerX; }
set
{
this._centerX = value;
this.IsPathDirty = true;
if(_centerX != value)
{
this._centerX = value;
this.IsPathDirty = true;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "cx", Value = value });
}
}
}
[SvgAttribute("cy")]
public virtual SvgUnit CenterY
{
get { return this._centerY; }
set
{
this._centerY = value;
this.IsPathDirty = true;
}
get { return this._centerY; }
set
{
if(_centerY != value)
{
this._centerY = value;
this.IsPathDirty = true;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "cy", Value = value });
}
}
}
[SvgAttribute("r")]
public virtual SvgUnit Radius
{
get { return this._radius; }
set { this._radius = value; this.IsPathDirty = true; }
get { return this._radius; }
set
{
if(_radius != value)
{
this._radius = value;
this.IsPathDirty = true;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "r", Value = value });
}
}
}
/// <summary>
......
......@@ -46,13 +46,16 @@ namespace Svg
[SvgAttribute("x")]
public SvgUnit X
{
get { return _x; }
set
{
_x = value;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "x", Value = value });
IsPathDirty = true;
}
get { return _x; }
set
{
if(_x != value)
{
_x = value;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "x", Value = value });
IsPathDirty = true;
}
}
}
/// <summary>
......@@ -61,13 +64,16 @@ namespace Svg
[SvgAttribute("y")]
public SvgUnit Y
{
get { return _y; }
set
{
_y = value;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "y", Value = value });
IsPathDirty = true;
}
get { return _y; }
set
{
if(_y != value)
{
_y = value;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "y", Value = value });
IsPathDirty = true;
}
}
}
/// <summary>
......@@ -76,13 +82,16 @@ namespace Svg
[SvgAttribute("width")]
public SvgUnit Width
{
get { return _width; }
set
{
_width = value;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "width", Value = value });
IsPathDirty = true;
}
get { return _width; }
set
{
if(_width != value)
{
_width = value;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "width", Value = value });
IsPathDirty = true;
}
}
}
/// <summary>
......@@ -91,13 +100,16 @@ namespace Svg
[SvgAttribute("height")]
public SvgUnit Height
{
get { return _height; }
set
{
_height = value;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "height", Value = value });
IsPathDirty = true;
}
get { return _height; }
set
{
if(_height != value)
{
_height = value;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "height", Value = value });
IsPathDirty = true;
}
}
}
/// <summary>
......
......@@ -18,7 +18,6 @@ namespace Svg
public class SvgPath : SvgVisualElement
{
private GraphicsPath _path;
private int _pathLength;
/// <summary>
/// Gets or sets a <see cref="SvgPathSegmentList"/> of path data.
......@@ -41,8 +40,8 @@ namespace Svg
[SvgAttribute("pathLength")]
public int PathLength
{
get { return this._pathLength; }
set { this._pathLength = value; }
get { return this.Attributes.GetAttribute<int>("pathLength"); }
set { this.Attributes["pathLength"] = value; }
}
......
......@@ -85,13 +85,16 @@ namespace Svg
[SvgAttribute("x")]
public virtual SvgUnit X
{
get { return this._x; }
set
{
this._x = value;
this.IsPathDirty = true;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "x", Value = value });
}
get { return this._x; }
set
{
if(_x != value)
{
this._x = value;
this.IsPathDirty = true;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "x", Value = value });
}
}
}
/// <summary>
......@@ -101,13 +104,16 @@ namespace Svg
[SvgAttribute("y")]
public virtual SvgUnit Y
{
get { return this._y; }
set
{
this._y = value;
this.IsPathDirty = true;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "y", Value = value });
}
get { return this._y; }
set
{
if(_y != value)
{
this._y = value;
this.IsPathDirty = true;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "y", Value = value });
}
}
}
/// <summary>
......
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