Курсовая работа: Разбиение Делоне
}
private void Ellipse_MouseMove(object sender, MouseEventArgs e)
{
if (isMouseDown)
{
Ellipse b = sender as Ellipse;
double currX = e.GetPosition(this).X;
double currY = e.GetPosition(this).Y;
double left = (double)b.GetValue(Canvas.LeftProperty);
double top = (double)b.GetValue(Canvas.TopProperty);
b.SetValue(Canvas.LeftProperty, left + currX - beginX);
b.SetValue(Canvas.TopProperty, top + currY - beginY);
beginX = currX;
beginY = currY;
ReCalclateDeloneCircle();
}
}
private void Window_KeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Left:
shape.SetValue(Canvas.LeftProperty, (double)shape.GetValue(Canvas.LeftProperty) - 1);
break;
case Key.Right:
shape.SetValue(Canvas.LeftProperty, (double)shape.GetValue(Canvas.LeftProperty) + 1);
break;
case Key.Up:
shape.SetValue(Canvas.TopProperty, (double)shape.GetValue(Canvas.TopProperty) - 1);