This commit is contained in:
Данил Лопатин 2024-02-19 10:19:47 +03:00
parent d53c9971d2
commit 373daa8bba
2 changed files with 10 additions and 11 deletions

2
.gitignore vendored
View File

@ -5,6 +5,8 @@
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.exe
*.bin
*.rsuser
*.suo
*.user

View File

@ -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;
}
}