コード例 #1
0
            /// <summary>
            /// Draws the background.
            /// </summary>
            /// <param name="dc">The graphics object we render to.</param>
            /// <param name="nvd">The view data of this node in the current view.</param>
            /// <param name="renderDepth">The depth which is still rendered.</param>
            /// <param name="padding">The padding between the nodes.</param>
            public void DrawBackground(DrawingContext dc, NodeViewData nvd, int renderDepth, Size padding)
            {
                Size size = nvd.GetTotalSize(padding.Width, renderDepth);

                if (_backgroundColor != CommentColor.NoColor)
                {
                    double commentPadding = Math.Min(padding.Height, padding.Width) * 0.75;

                    dc.DrawRoundedRectangle(_backgroundBrush, null, new Rect(nvd.LayoutRectangle.X - commentPadding * 0.5, nvd.LayoutRectangle.Y - commentPadding * 0.5, size.Width + commentPadding, size.Height + commentPadding), 6.0, 6.0);
                }
            }
コード例 #2
0
ファイル: Node.Comment.cs プロジェクト: yh821/Zombie
            /// <summary>
            /// Draws the background.
            /// </summary>
            /// <param name="graphics">The graphics object we render to.</param>
            /// <param name="nvd">The view data of this node in the current view.</param>
            /// <param name="renderDepth">The depth which is still rendered.</param>
            /// <param name="padding">The padding between the nodes.</param>
            public void DrawBackground(Graphics graphics, NodeViewData nvd, int renderDepth, SizeF padding)
            {
                SizeF size = nvd.GetTotalSize(padding.Width, renderDepth);

                if (_backgroundColor != CommentColor.NoColor)
                {
                    float commentPadding = Math.Min(padding.Height, padding.Width) * 0.75f;

                    ExtendedGraphics extended = new ExtendedGraphics(graphics);
                    extended.FillRoundRectangle(_backgroundBrush, nvd.LayoutRectangle.X - commentPadding * 0.5f, nvd.LayoutRectangle.Y - commentPadding * 0.5f, size.Width + commentPadding, size.Height + commentPadding, 6.0f);
                }
            }
コード例 #3
0
ファイル: Node.Comment.cs プロジェクト: KeyleXiao/behaviac
            /// <summary>
            /// Draws the background.
            /// </summary>
            /// <param name="graphics">The graphics object we render to.</param>
            /// <param name="nvd">The view data of this node in the current view.</param>
            /// <param name="renderDepth">The depth which is still rendered.</param>
            /// <param name="padding">The padding between the nodes.</param>
            public void DrawBackground(Graphics graphics, NodeViewData nvd, int renderDepth, SizeF padding)
            {
                SizeF size = nvd.GetTotalSize(padding.Width, renderDepth);

                if (_backgroundColor != CommentColor.NoColor)
                {
                    float commentPadding = Math.Min(padding.Height, padding.Width) * 0.75f;

                    ExtendedGraphics extended = new ExtendedGraphics(graphics);
                    extended.FillRoundRectangle(_backgroundBrush, nvd.LayoutRectangle.X - commentPadding * 0.5f, nvd.LayoutRectangle.Y - commentPadding * 0.5f, size.Width + commentPadding, size.Height + commentPadding, 0.05f);
                }
            }