예제 #1
0
        /// <summary>
        /// 追加
        /// </summary>
        private void Add()
        {
            Vector2 mPoint;

            if (!editor.GetMousePoint(out mPoint))
            {
                return;
            }

            //例外検出
            if (!editor.checker.AddCheck(renderer.GetVertices(), mPoint))
            {
                return;
            }

            //スナップ
            Vector2 snapPoint;

            if (editor.supporter.Snap(mPoint, out snapPoint))
            {
                mPoint = snapPoint;
                //終了スナップ確認
                editor.supporter.SnapCallback();
                if (exit)
                {
                    //追加
                    renderer.Add(mPoint);
                    Exit();
                    return;
                }
            }

            //追加
            renderer.Add(mPoint);

            //スナップの設定
            SetSnap();
        }
예제 #2
0
 /// <summary>
 /// 頂点の挿入
 /// </summary>
 private void InsertVertex(int index, Vector2 point)
 {
     renderer.Insert(index, point);
     StartVertexMove(renderer.GetVertices(), index);
 }