コード例 #1
0
        /// <summary>
        /// Sets the original node bounds according to the given anchor location and size.
        /// </summary>
        private RectD SetNodeLocationAndSize(IInputModeContext inputModeContext, PointD anchor, SizeD size)
        {
            var graph = inputModeContext.GetGraph();

            if (graph == null)
            {
                return(RectD.Empty);
            }
            var orientedRectangle = new OrientedRectangle(anchor.X, anchor.Y, size.Width, size.Height,
                                                          initialLayout.UpX, initialLayout.UpY);
            var center = orientedRectangle.GetCenter();

            var layout = RectD.FromCenter(center, size);

            graph.SetNodeLayout(node, layout);
            return(layout);
        }