private void MoveHandleByNum(char n, Freedom f)
        {
            Rectangle h = handles.Find(i => i.Name.Last() == n);

            switch (f)
            {
            case Freedom.LeftRight:
                Canvas.SetLeft(h, Mouse.GetPosition(canvas).X - handle_size / 2 - init_mouse.X);
                break;

            case Freedom.UpDown:
                Canvas.SetTop(h, Mouse.GetPosition(canvas).Y - handle_size / 2 - init_mouse.Y);
                break;

            case Freedom.Both:
                Canvas.SetLeft(h, Mouse.GetPosition(canvas).X - handle_size / 2 - init_mouse.X);
                Canvas.SetTop(h, Mouse.GetPosition(canvas).Y - handle_size / 2 - init_mouse.Y);
                break;

            default:
                break;
            }
            ClampHandleByNum(n);
        }
Example #2
0
 static HeatMap() {
     Pos = Positioning.E;
     Frdm = Freedom.FREE;
 }