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;