Exemplo n.º 1
0
        /// <summary>
        /// 直線と直線の交わりにベジェを挿入し角丸めにする。
        /// </summary>
        /// <returns></returns>
        internal bool InsRoundCorner()
        {
            if (!CurrentIndex.IsValid())
            {
                return(false);
            }


            var path = Paths[CurrentIndex.BlockIndex];

            if (path.Count <= CurrentIndex.ItemIndex + 1)
            {
                return(false);
            }
            var item = path[CurrentIndex.ItemIndex];
            // M の時は未対応
            var next = path[CurrentIndex.ItemIndex + 1];

            if (!item.IsL() || !(next.IsL() || next.IsZ()))
            {
                return(false);
            }


            if (next.IsZ())
            {
                next = path[0]; // M のはず!
            }
            var         pn = next.GetPoint();
            SvgPathItem cp = item.CreateRoundCorner(pn);

            path.Insert(CurrentIndex.ItemIndex + 1, cp);
            next.SetBefor(cp);
            cp.SetBefor(item);

            return(true);
        }