LabWork01 #1

Merged
eegov merged 3 commits from LabWork01 into master 2022-10-21 09:01:17 +04:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit 1f16cad283 - Show all commits

View File

@ -24,9 +24,9 @@ namespace AirBomber
public void SetPosition(int x, int y, int width, int height)
{
if (x > _pictureWidth || x < 0) return;
if (x + _airBomberWidth > width || x < 0) return;
Review

Не учтены все условия, при которых объект может выйти за границы

Не учтены все условия, при которых объект может выйти за границы
else _startPosX = x;
if (y > _pictureHeight || y < 0) return;
if (y + _airBomberHeight> height || y < 0) return;
else _startPosY = y;
_pictureWidth = width;
_pictureHeight = height;

View File

@ -48,6 +48,7 @@
this.pictureBoxAirBomber.Location = new System.Drawing.Point(0, 0);
this.pictureBoxAirBomber.Name = "pictureBoxAirBomber";
this.pictureBoxAirBomber.Size = new System.Drawing.Size(874, 515);
this.pictureBoxAirBomber.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.pictureBoxAirBomber.TabIndex = 0;
this.pictureBoxAirBomber.TabStop = false;
this.pictureBoxAirBomber.Resize += new System.EventHandler(this.PictureBoxAirBomber_Resize);