Fix default gradient offset for add button

This commit is contained in:
Jaex 2020-06-08 22:53:46 +03:00
parent 0a106e28cd
commit c94e40b4a3
2 changed files with 2 additions and 8 deletions

View file

@ -38,13 +38,7 @@ public class GradientInfo
public List<GradientStop> Colors { get; set; } public List<GradientStop> Colors { get; set; }
public bool IsValid public bool IsValid => Colors != null && Colors.Count > 0;
{
get
{
return Colors != null && Colors.Count > 0;
}
}
public GradientInfo() public GradientInfo()
{ {

View file

@ -92,7 +92,7 @@ private void AddGradientStop(GradientStop gradientStop)
private void btnAdd_Click(object sender, EventArgs e) private void btnAdd_Click(object sender, EventArgs e)
{ {
Color color = cbtnCurrentColor.Color; Color color = cbtnCurrentColor.Color;
float offset = (float)(nudLocation.Value / 100); float offset = (float)nudLocation.Value;
GradientStop gradientStop = new GradientStop(color, offset); GradientStop gradientStop = new GradientStop(color, offset);
Gradient.Colors.Add(gradientStop); Gradient.Colors.Add(gradientStop);
AddGradientStop(gradientStop); AddGradientStop(gradientStop);