From 45c7fb8ab3f46554dc11fd6cfc8b8957073f1700 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Tue, 10 Oct 2023 11:59:02 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=BE=20=D0=BD=D0=B0=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=D0=B0=20=D0=BE?= =?UTF-8?q?=D0=B1=D1=8A=D0=B5=D0=BA=D1=82=D0=BE=D0=B2=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=84=D0=BE=D1=80=D0=BC=D0=B5=20=D1=81=20=D0=BA=D0=BE=D0=BB?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=86=D0=B8=D0=B5=D0=B9=20=D0=BE=D0=B1=D1=8A?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FormStormtrooper.Designer.cs | 16 ++++++++-------- .../PlanesGenericCollection.cs | 5 +++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ProjectStormtrooper/ProjectStormtrooper/FormStormtrooper.Designer.cs b/ProjectStormtrooper/ProjectStormtrooper/FormStormtrooper.Designer.cs index fae413c..30b4862 100644 --- a/ProjectStormtrooper/ProjectStormtrooper/FormStormtrooper.Designer.cs +++ b/ProjectStormtrooper/ProjectStormtrooper/FormStormtrooper.Designer.cs @@ -46,7 +46,7 @@ pictureBoxStormtrooper.Dock = DockStyle.Fill; pictureBoxStormtrooper.Location = new Point(0, 0); pictureBoxStormtrooper.Name = "pictureBoxStormtrooper"; - pictureBoxStormtrooper.Size = new Size(1043, 546); + pictureBoxStormtrooper.Size = new Size(948, 546); pictureBoxStormtrooper.SizeMode = PictureBoxSizeMode.AutoSize; pictureBoxStormtrooper.TabIndex = 0; pictureBoxStormtrooper.TabStop = false; @@ -67,7 +67,7 @@ buttonUp.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; buttonUp.BackgroundImage = Properties.Resources.arrowUP; buttonUp.BackgroundImageLayout = ImageLayout.Zoom; - buttonUp.Location = new Point(965, 468); + buttonUp.Location = new Point(870, 468); buttonUp.Name = "buttonUp"; buttonUp.Size = new Size(30, 30); buttonUp.TabIndex = 2; @@ -79,7 +79,7 @@ buttonDown.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; buttonDown.BackgroundImage = Properties.Resources.arrowDOWN; buttonDown.BackgroundImageLayout = ImageLayout.Zoom; - buttonDown.Location = new Point(965, 504); + buttonDown.Location = new Point(870, 504); buttonDown.Name = "buttonDown"; buttonDown.Size = new Size(30, 30); buttonDown.TabIndex = 3; @@ -91,7 +91,7 @@ buttonLeft.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; buttonLeft.BackgroundImage = Properties.Resources.arrowLEFT; buttonLeft.BackgroundImageLayout = ImageLayout.Zoom; - buttonLeft.Location = new Point(929, 504); + buttonLeft.Location = new Point(834, 504); buttonLeft.Name = "buttonLeft"; buttonLeft.Size = new Size(30, 30); buttonLeft.TabIndex = 4; @@ -103,7 +103,7 @@ buttonRight.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; buttonRight.BackgroundImage = Properties.Resources.arrowRIGHT; buttonRight.BackgroundImageLayout = ImageLayout.Zoom; - buttonRight.Location = new Point(1001, 504); + buttonRight.Location = new Point(906, 504); buttonRight.Name = "buttonRight"; buttonRight.Size = new Size(30, 30); buttonRight.TabIndex = 5; @@ -127,7 +127,7 @@ comboBoxStrategy.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxStrategy.FormattingEnabled = true; comboBoxStrategy.Items.AddRange(new object[] { "MoveToCenter", "MoveToRightBottom" }); - comboBoxStrategy.Location = new Point(880, 12); + comboBoxStrategy.Location = new Point(785, 12); comboBoxStrategy.Name = "comboBoxStrategy"; comboBoxStrategy.Size = new Size(151, 28); comboBoxStrategy.TabIndex = 7; @@ -135,7 +135,7 @@ // buttonStep // buttonStep.Anchor = AnchorStyles.Top | AnchorStyles.Right; - buttonStep.Location = new Point(937, 46); + buttonStep.Location = new Point(842, 46); buttonStep.Name = "buttonStep"; buttonStep.Size = new Size(94, 29); buttonStep.TabIndex = 8; @@ -157,7 +157,7 @@ // AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(1043, 546); + ClientSize = new Size(948, 546); Controls.Add(buttonSelectPlane); Controls.Add(buttonStep); Controls.Add(comboBoxStrategy); diff --git a/ProjectStormtrooper/ProjectStormtrooper/PlanesGenericCollection.cs b/ProjectStormtrooper/ProjectStormtrooper/PlanesGenericCollection.cs index ed59c80..91704fa 100644 --- a/ProjectStormtrooper/ProjectStormtrooper/PlanesGenericCollection.cs +++ b/ProjectStormtrooper/ProjectStormtrooper/PlanesGenericCollection.cs @@ -116,14 +116,15 @@ namespace ProjectStormtrooper private void DrawObjects(Graphics g) { int placesColumnCount = _pictureHeight / _placeSizeHeight; + int placesRowCount = _pictureWidth / _placeSizeWidth; for (int i = 0; i < _collection.Count; i++) { // получение объекта var obj = _collection.Get(i); // установка позиции obj?.SetPosition( - (int)(i / placesColumnCount * _placeSizeWidth + (_placeSizeWidth - obj?.GetWidth) / 2), - (int)(i % placesColumnCount * _placeSizeHeight + (_placeSizeHeight - obj?.GetHeight) / 2) + (int)((placesRowCount - 1) * _placeSizeWidth - (i % placesColumnCount * _placeSizeWidth) + (_placeSizeWidth - obj?.GetWidth) / 2), + (int)(i / placesColumnCount * _placeSizeHeight + (_placeSizeHeight - obj?.GetHeight) / 2) ); // прорисовка объекта obj?.DrawTransport(g);