Exemplo n.º 1
0
        private void reName(int selectedId)
        {
            reNameBox.Font = font_name;
            string oldName    = skillList[selectedId].name;
            Point  sizeOfName = (Point)getNameSize(oldName);

            reNameBox.Size = (Size)sizeOfName;
            Geom.scale(ref sizeOfName, 1, 2);
            reNameBox.Location = Point.Round(circleCenter[selectedId]) - (Size)sizeOfName;
            reNameBox.Text     = oldName;
            reNameBox.Show();
            reNameBox.Focus();
            reNameBox.SelectAll();
            selectedId_renameBox = selectedId;
        }
Exemplo n.º 2
0
 int getArrowPioner(Point locate)
 {
     for (int i = 0; i < skillList.Count; i++)
     {
         var currTail = skillList[i].getTail;
         foreach (int ed in currTail)
         {
             if (Geom.pointInArrowHand(locate, Geom.getArrowHead(circleCenter[i], circleCenter[ed], size_circle)))
             {
                 return(i);
             }
         }
     }
     return(selectedId_None);
 }
Exemplo n.º 3
0
        private void scaleAllCenter(Point Anchor, Point before, Point after)
        {
            Point anc = Anchor;
            int   zo  = Geom.Length(before - (Size)Anchor);
            int   zi  = Geom.Length(after - (Size)Anchor);

            scaleOther(zi, zo);
            for (int i = 0; i < circleCenter.Count; i++)
            {
                circleCenter[i] = Geom.scale(circleCenter[i], zi, zo);
            }
            anc  = Geom.scale(anc, zi, zo);
            anc -= (Size)Anchor;
            panAllCircle(anc);
        }
Exemplo n.º 4
0
        private void DrawArrow(PointF _st, PointF _ed, DrawStyle start)
        {
            Point st     = Point.Round(_st);
            Point ed     = Point.Round(_ed);
            int   length = Geom.Distance(st, ed);

            if (length <= size_circle * 2)
            {
                return;
            }
            Point[] pointList = Geom.getArrowHead(st, ed, size_circle);
            Geom.scaleLine(ref st, ref ed, size_circle);
            if (start.ArrowLine.IsEmpty == false)
            {
                Pen edPen = new Pen(start.ArrowLine);
                edPen.Width = lineW;
                buffer.DrawLine(edPen, st, pointList[0]);
            }
            DrawArrow(pointList, start);
        }
Exemplo n.º 5
0
 private void DependencyView_MouseMove(object sender, MouseEventArgs e)
 {
     if (anchorExist == true && selectedId_drag == selectedId_None && MouseLeftButtonIsDown)
     {
         if (Geom.Distance(e.Location, Anchors) > size_anchor)
         {
             moveAllCenter(Anchors, rotateMouseLocate, e.Location);
         }
     }
     if (selectedId_drag != selectedId_None && MouseLeftButtonIsDown)
     {
         Point offset = locate_mouse - (Size)e.Location;
         circleCenter[selectedId_drag] -= (Size)offset;
     }
     if (BackspaceIsDown == true && MouseLeftButtonIsDown)
     {
         Point deviaion;
         deviaion = locate_mouse - (Size)e.Location;
         deviaion = moveAllSkill(deviaion);
     }
     rotateMouseLocate = e.Location;
     locate_mouse      = e.Location;
     Flash();
 }