ISEbd-22 Musatkina K. Y. Lab work 8 #12
@ -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);
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user