refactoring lab

This commit is contained in:
ZakenChannel 2024-02-27 16:27:17 +04:00
parent ba5f953c30
commit 562a57db07
3 changed files with 2 additions and 14 deletions

View File

@ -83,7 +83,6 @@ public class DrawningAirFighter
_startPosY = _pictureHeight.Value - _drawningAirFighterHeight;
}
}
return true;
}
/// <summary>
@ -109,7 +108,6 @@ public class DrawningAirFighter
{
_startPosX = 0;
}
return;
}
/// <summary>

View File

@ -46,7 +46,6 @@
pictureBoxAirFighter.SizeMode = PictureBoxSizeMode.AutoSize;
pictureBoxAirFighter.TabIndex = 0;
pictureBoxAirFighter.TabStop = false;
pictureBoxAirFighter.Resize += new System.EventHandler(this.PictureBox_Resize);
//
// buttonCreateAirFighter
//

View File

@ -26,10 +26,7 @@ public partial class FormAirFighter : Form
/// </summary>
private void Draw()
{
if (_drawningAirFighter == null)
{
return;
}
if (_drawningAirFighter == null) return;
if (pictureBoxAirFighter.Width == 0 || pictureBoxAirFighter.Height == 0) return;
Bitmap bitmap = new(pictureBoxAirFighter.Width, pictureBoxAirFighter.Height);
Graphics gr = Graphics.FromImage(bitmap);
@ -38,7 +35,7 @@ public partial class FormAirFighter : Form
}
/// <summary>
/// Обработка нажатия кнопки создать
/// Обработка нажатия кнопки "Создать"
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
@ -90,10 +87,4 @@ public partial class FormAirFighter : Form
}
if (result) Draw();
}
private void PictureBox_Resize(object sender, EventArgs e)
{
_drawningAirFighter?.SetPictureSize(pictureBoxAirFighter.Width, pictureBoxAirFighter.Height);
Draw();
}
}