Полностью сделанная лабораторная №1 базовая.

This commit is contained in:
the 2022-09-21 10:49:29 +04:00
parent 372c0be8d8
commit 1f16cad283
2 changed files with 3 additions and 2 deletions

View File

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

View File

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