зеркало из https://github.com/wieslawsoltes/SVG.git
now doing element wise matrix comparison
This commit is contained in:
Родитель
f20108c812
Коммит
1758a5b56c
|
@ -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()
|
||||
|
|
Загрузка…
Ссылка в новой задаче