Esempio n. 1
0
        /// <summary>
        /// Returns bounds based on the size provided by the wrapped style and the location and rotation of the node.
        /// </summary>
        protected override RectD GetBounds(ICanvasContext context, INode node)
        {
            var nodeOrientedRect = GetRotatedLayout(node);

            // Create an oriented rectangle with the size of the wrapped bounds and the location and rotation of the node
            var wrappedBounds = Wrapped.Renderer.GetBoundsProvider(node, Wrapped).GetBounds(context);

            var orientedRectangle = new OrientedRectangle(0, 0, wrappedBounds.Width, wrappedBounds.Height,
                                                          nodeOrientedRect.UpX, nodeOrientedRect.UpY);

            orientedRectangle.SetCenter(node.Layout.GetCenter());

            return(orientedRectangle.GetBounds());
        }