mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Color gradient editor - Fixed deleting stops with the X-button
This commit is contained in:
parent
cbf2cd1736
commit
f6f65f7ef0
@ -87,12 +87,12 @@ public class GradientPicker : TemplatedControl
|
|||||||
if (ColorGradient.Count <= 2)
|
if (ColorGradient.Count <= 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int index = ColorGradient.IndexOf(s);
|
int index = EditingColorGradient.IndexOf(s);
|
||||||
ColorGradient.Remove(s);
|
EditingColorGradient.Remove(s);
|
||||||
if (index > ColorGradient.Count - 1)
|
if (index > EditingColorGradient.Count - 1)
|
||||||
index--;
|
index--;
|
||||||
|
|
||||||
SelectedColorStop = ColorGradient.ElementAtOrDefault(index);
|
SelectedColorStop = EditingColorGradient.ElementAtOrDefault(index);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,12 +310,7 @@ public class GradientPicker : TemplatedControl
|
|||||||
if (e.Key != Key.Delete || SelectedColorStop == null || EditingColorGradient.Count <= 2)
|
if (e.Key != Key.Delete || SelectedColorStop == null || EditingColorGradient.Count <= 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int index = EditingColorGradient.IndexOf(SelectedColorStop);
|
DeleteStop.Execute(SelectedColorStop);
|
||||||
EditingColorGradient.Remove(SelectedColorStop);
|
|
||||||
if (index > EditingColorGradient.Count - 1)
|
|
||||||
index--;
|
|
||||||
|
|
||||||
SelectedColorStop = EditingColorGradient.ElementAtOrDefault(index);
|
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user