Commit 1758a5b5 authored by tebjan's avatar tebjan
Browse files

now doing element wise matrix comparison

parent f20108c8
......@@ -92,7 +92,7 @@ namespace Svg
if(base.ContainsKey(attributeName))
{
var oldVal = base[attributeName];
if(TryUnboxAndCheck(oldVal, value))
if(TryUnboxedCheck(oldVal, value))
{
base[attributeName] = value;
OnAttributeChanged(attributeName, value);
......@@ -106,13 +106,10 @@ namespace Svg
}
}
private bool TryUnboxAndCheck(object a, object b)
private bool TryUnboxedCheck(object a, object b)
{
System.Diagnostics.Debug.WriteLine("object type: " + a.GetType().ToString());
if(IsValueType(a))
{
System.Diagnostics.Debug.WriteLine("is value type");
if(a is SvgUnit)
return UnboxAndCheck<SvgUnit>(a, b);
else if(a is bool)
......
......@@ -19,7 +19,17 @@ namespace Svg.Transforms
SvgTransform other = obj as SvgTransform;
if (other == null)
return false;
return this.Matrix == other.Matrix;
var thisMatrix = this.Matrix.Elements;
var otherMatrix = other.Matrix.Elements;
for (int i = 0; i < 6; i++)
{
if(thisMatrix[i] != otherMatrix[i])
return false;
}
return true;
}
public override int GetHashCode()
......
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