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 ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files # User-specific files
*.exe
*.bin
*.rsuser *.rsuser
*.suo *.suo
*.user *.user

View File

@ -79,25 +79,22 @@ public class DrawningWarmlyLocomotive
return; return;
} }
if((x + _drawningLocomotiveWidth > _pictureWidth ) && (y + _drawningLocomotiveHeight > _pictureHeight)) if ((y + _drawningLocomotiveHeight) > _pictureHeight)
{ {
_startPosX = x - _drawningLocomotiveWidth;
_startPosY = y - _drawningLocomotiveHeight; _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; _startPosY = y;
} }
if ((x + _drawningLocomotiveWidth) > _pictureWidth)
{
_startPosX = x - _drawningLocomotiveWidth;
}
else else
{ {
_startPosX = x; _startPosX = x;
_startPosY = y;
} }
} }