refactoring lab
This commit is contained in:
parent
ba5f953c30
commit
562a57db07
@ -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>
|
||||
|
@ -46,7 +46,6 @@
|
||||
pictureBoxAirFighter.SizeMode = PictureBoxSizeMode.AutoSize;
|
||||
pictureBoxAirFighter.TabIndex = 0;
|
||||
pictureBoxAirFighter.TabStop = false;
|
||||
pictureBoxAirFighter.Resize += new System.EventHandler(this.PictureBox_Resize);
|
||||
//
|
||||
// buttonCreateAirFighter
|
||||
//
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user