diff --git a/Boats/Boats/EntityCatamaran.cs b/Boats/Boats/EntityCatamaran.cs index 4ad7d8b..14f907c 100644 --- a/Boats/Boats/EntityCatamaran.cs +++ b/Boats/Boats/EntityCatamaran.cs @@ -37,5 +37,9 @@ namespace Boats Bobbers = bobbers; Sail = sail; } + public void SetDopColor(Color color) + { + DopColor = color; + } } } diff --git a/Boats/Boats/FormBoatConfig.cs b/Boats/Boats/FormBoatConfig.cs index 62e374b..d619df8 100644 --- a/Boats/Boats/FormBoatConfig.cs +++ b/Boats/Boats/FormBoatConfig.cs @@ -147,10 +147,9 @@ namespace Boats /// 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(); } /// @@ -176,10 +175,9 @@ namespace Boats /// 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(); } ///