зафиксировать

This commit is contained in:
Kristina 2023-12-25 21:44:25 +04:00
parent 646780ae8a
commit 9f19a61ae6
2 changed files with 4 additions and 19 deletions

View File

@ -1,15 +0,0 @@
using ProjectBoat_bae.DrawningObjects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectBoat_bae
{
internal class BoatDelegate
{
// Делегат для передачи объекта
public delegate void boatDelegate(Drawningboat boat);
}
}

View File

@ -74,13 +74,13 @@ namespace ProjectBoat_bae.DrawningObjects
// Установка позиции
public void SetPosition(int x, int y)
{
if (x < 0 || x + _boatWidth > _pictureWidth + 90)
if (x < 0 || x + _boatWidth > _pictureWidth)
{
x = Math.Max(0, _pictureWidth - _boatWidth);
x = Math.Max(0, _pictureWidth - _boatWidth + 90);
}
if (y < 0 || y + _boatHeight > _pictureHeight + 60)
if (y < 0 || y + _boatHeight > _pictureHeight)
{
y = Math.Max(0, _pictureHeight - _boatHeight);
y = Math.Max(0, _pictureHeight - _boatHeight+ 90);
}
_startPosX = x;
_startPosY = y;