Fixed hash-calculation

This commit is contained in:
DarthAffe committed 2017-01-14 23:21:06 +01:00
1 parent aa870f1c2e
commit 13b20c154e
1 file changed
+9 -1
@@ -33,7 +33,7 @@ namespace Artemis.Profiles.Layers.Types.AngularBrush.Drawing
{
set
{
int hash = value.GetHashCode();
int hash = GetHash(value);
if (_lastGradientHash != hash)
{
_gradientStops = FixGradientStops(value);
@@ -176,6 +176,14 @@ namespace Artemis.Profiles.Layers.Types.AngularBrush.Drawing
return stops;
}
private static int GetHash(IList<Tuple<double, Color>> sequence)
{
unchecked
{
return sequence.Aggregate(487, (current, item) => (((current * 31) + item.Item1.GetHashCode()) * 31) + item.Item2.GetHashCode());
}
}
#endregion
}
}