diff --git a/.gitignore b/.gitignore index ca1c7a3..0e380c3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore # User-specific files +*.exe +*.bin *.rsuser *.suo *.user diff --git a/WarmlyLocomotive/DrawningWarmlyLocomotive.cs b/WarmlyLocomotive/DrawningWarmlyLocomotive.cs index 354ec17..adc1c01 100644 --- a/WarmlyLocomotive/DrawningWarmlyLocomotive.cs +++ b/WarmlyLocomotive/DrawningWarmlyLocomotive.cs @@ -78,26 +78,23 @@ public class DrawningWarmlyLocomotive { return; } - - if((x + _drawningLocomotiveWidth > _pictureWidth ) && (y + _drawningLocomotiveHeight > _pictureHeight)) + + if ((y + _drawningLocomotiveHeight) > _pictureHeight) { - _startPosX = x - _drawningLocomotiveWidth; _startPosY = y - _drawningLocomotiveHeight; } - else if((x + _drawningLocomotiveWidth <= _pictureWidth) && (y + _drawningLocomotiveHeight > _pictureHeight)) + else { - _startPosX = x; - _startPosY = y - _drawningLocomotiveHeight; - } - else if ((x + _drawningLocomotiveWidth > _pictureWidth) && (y + _drawningLocomotiveHeight <= _pictureHeight)) - { - _startPosX = x - _drawningLocomotiveWidth; _startPosY = y; } + + if ((x + _drawningLocomotiveWidth) > _pictureWidth) + { + _startPosX = x - _drawningLocomotiveWidth; + } else { _startPosX = x; - _startPosY = y; } }