Esempio n. 1
0
 public void AddSpline(Spline s)
 {
 }
Esempio n. 2
0
 private void SplineManipulator(Line l)
 {
     if (mHeldSpline != null)
     {
         if (IM.GetMouseButton(MouseButton.Left))
         {
             if (mControlPoint == 0)
             {
                 mHeldSpline.position = new Vector2(IM.FmouseX() + mOffset.X, IM.FmouseY() + mOffset.Y);
             }
             else if (mControlPoint == 1)
             {
                 if (lockControlPoint)
                 {
                     mHeldSpline.moveControlPointLocked(new Vector2(IM.FmouseX() + mOffset.X, IM.FmouseY() + mOffset.Y), true);
                 }
                 else
                 {
                     mHeldSpline.moveControlPoint(new Vector2(IM.FmouseX() + mOffset.X, IM.FmouseY() + mOffset.Y), true);
                 }
             }
             else
             {
                 if (lockControlPoint)
                 {
                     mHeldSpline.moveControlPointLocked(new Vector2(IM.FmouseX() + mOffset.X, IM.FmouseY() + mOffset.Y), false);
                 }
                 else
                 {
                     mHeldSpline.moveControlPoint(new Vector2(IM.FmouseX() + mOffset.X, IM.FmouseY() + mOffset.Y), false);
                 }
             }
         }
         else
         {
             mHeldSpline = null;
         }
     }
     else
     {
         foreach (Spline s in l.splines)
         {
             if (IM.MouseButtonDown(MouseButton.Left))
             {
                 if (IM.FisMouseInRect(new FRect(s.GlobalLeft(), 0.04f)))
                 {
                     mOffset       = new Vector2(s.GlobalLeft().X - IM.FmouseX(), s.GlobalLeft().Y - IM.FmouseY());
                     mHeldSpline   = s;
                     mControlPoint = 1;
                     lineIndex     = d.lines.IndexOf(l);
                 }
                 if (IM.FisMouseInRect(new FRect(s.GlobalRight(), 0.04f)))
                 {
                     mOffset       = new Vector2(s.GlobalRight().X - IM.FmouseX(), s.GlobalRight().Y - IM.FmouseY());
                     mHeldSpline   = s;
                     mControlPoint = 2;
                     lineIndex     = d.lines.IndexOf(l);
                 }
                 else if (IM.FisMouseInRect(new FRect(s.position, 0.04f)))
                 {
                     mOffset       = new Vector2(s.position.X - IM.FmouseX(), s.position.Y - IM.FmouseY());
                     mHeldSpline   = s;
                     mControlPoint = 0;
                     lineIndex     = d.lines.IndexOf(l);
                 }
             }
         }
     }
 }