From 2678df6efed362562d211520045d8c1be95b53e1 Mon Sep 17 00:00:00 2001 From: BoiledMilk123 Date: Mon, 26 Feb 2024 22:01:19 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=201.=20=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DrawningElectricLocomotive.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs index 1842639..3b5a2f6 100644 --- a/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs @@ -76,13 +76,13 @@ public class DrawningElectricLocomotive return false; } - if(_startPosY.HasValue && _startPosY - _drawningElectricLocomotiveHeight < _pictureHeight ) + if(_startPosY.HasValue && _startPosY + _drawningElectricLocomotiveHeight < _pictureHeight ) { - _startPosY -= _drawningElectricLocomotiveHeight; + _startPosY = _pictureHeight - _drawningElectricLocomotiveHeight; } - if (_startPosX.HasValue && _startPosX - _drawningElectricLocomotiveWidth < _pictureWidth ) + if (_startPosX.HasValue && _startPosX + _drawningElectricLocomotiveWidth < _pictureWidth ) { - _startPosX -= _drawningElectricLocomotiveWidth; + _startPosX = _pictureWidth - _drawningElectricLocomotiveWidth; } _pictureWidth = width; _pictureHeight = height;