FormConfig fixed

This commit is contained in:
Nikita Potapov 2022-11-15 11:15:37 +04:00
parent eb32a4c319
commit db90912206
2 changed files with 6 additions and 4 deletions

View File

@ -37,5 +37,9 @@ namespace Boats
Bobbers = bobbers;
Sail = sail;
}
public void SetDopColor(Color color)
{
DopColor = color;
}
}
}

View File

@ -147,10 +147,9 @@ namespace Boats
/// <param name="e"></param>
private void LabelBaseColor_DragDrop(object sender, DragEventArgs e)
{
labelBaseColor.BackColor = (Color)e.Data.GetData(typeof(Color).ToString());
if (_boat == null)
return;
_boat.Boat.BodyColor = labelBaseColor.BackColor;
_boat.Boat.BodyColor = (Color)e.Data.GetData(typeof(Color).ToString());
DrawBoat();
}
/// <summary>
@ -176,10 +175,9 @@ namespace Boats
/// <param name="e"></param>
private void LabelDopColor_DragDrop(object sender, DragEventArgs e)
{
labelDopColor.BackColor = (Color)e.Data.GetData(typeof(Color).ToString());
if (_boat == null || _boat is not DrawingCatamaran)
return;
(_boat.Boat as EntityCatamaran).DopColor = labelDopColor.BackColor;
(_boat.Boat as EntityCatamaran).SetDopColor((Color)e.Data.GetData(typeof(Color).ToString()));
DrawBoat();
}
/// <summary>