Лабораторная работа 1. Правки 2

This commit is contained in:
BoiledMilk123 2024-02-26 22:01:19 +04:00
parent 70bbd74e9e
commit 2678df6efe

View File

@ -76,13 +76,13 @@ public class DrawningElectricLocomotive
return false; 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; _pictureWidth = width;
_pictureHeight = height; _pictureHeight = height;