вроде готовая лаба

This commit is contained in:
Полина Чубыкина 2023-10-24 22:59:09 +04:00
parent fe3e0c632f
commit 1242541ec7
2 changed files with 5 additions and 5 deletions

View File

@ -137,8 +137,8 @@ namespace Sailboat.Generics
if (boat != null) if (boat != null)
{ {
int inRow = _pictureWidth / _placeSizeWidth; int width = _pictureWidth / _placeSizeWidth;
boat.SetPosition((inRow - 1 - (i % inRow)) * _placeSizeWidth, i / inRow * _placeSizeHeight); boat.SetPosition(i % width * _placeSizeWidth, (i / (_pictureWidth / _placeSizeWidth)) * _placeSizeHeight);
boat.DrawTransport(g); boat.DrawTransport(g);
} }
} }

View File

@ -42,7 +42,7 @@
// //
this.pictureBoxCollection.Location = new System.Drawing.Point(0, 0); this.pictureBoxCollection.Location = new System.Drawing.Point(0, 0);
this.pictureBoxCollection.Name = "pictureBoxCollection"; this.pictureBoxCollection.Name = "pictureBoxCollection";
this.pictureBoxCollection.Size = new System.Drawing.Size(700, 450); this.pictureBoxCollection.Size = new System.Drawing.Size(750, 450);
this.pictureBoxCollection.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBoxCollection.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.pictureBoxCollection.TabIndex = 0; this.pictureBoxCollection.TabIndex = 0;
this.pictureBoxCollection.TabStop = false; this.pictureBoxCollection.TabStop = false;
@ -54,7 +54,7 @@
this.panelTools.Controls.Add(this.buttonRefreshCollection); this.panelTools.Controls.Add(this.buttonRefreshCollection);
this.panelTools.Controls.Add(this.buttonRemoveBoat); this.panelTools.Controls.Add(this.buttonRemoveBoat);
this.panelTools.Controls.Add(this.buttonAddBoat); this.panelTools.Controls.Add(this.buttonAddBoat);
this.panelTools.Location = new System.Drawing.Point(707, 12); this.panelTools.Location = new System.Drawing.Point(756, 12);
this.panelTools.Name = "panelTools"; this.panelTools.Name = "panelTools";
this.panelTools.Size = new System.Drawing.Size(209, 426); this.panelTools.Size = new System.Drawing.Size(209, 426);
this.panelTools.TabIndex = 1; this.panelTools.TabIndex = 1;
@ -100,7 +100,7 @@
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(929, 450); this.ClientSize = new System.Drawing.Size(969, 450);
this.Controls.Add(this.panelTools); this.Controls.Add(this.panelTools);
this.Controls.Add(this.pictureBoxCollection); this.Controls.Add(this.pictureBoxCollection);
this.Name = "FormBoatCollection"; this.Name = "FormBoatCollection";