ISEbd-22 Musatkina K. Y. Lab work 8 #12

Closed
Kristina wants to merge 4 commits from lab8 into lab7
2 changed files with 4 additions and 19 deletions
Showing only changes of commit 9f19a61ae6 - Show all commits

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;