mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Fixed hash-calculation
This commit is contained in:
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
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user