ComponentFactory.Krypton.Toolkit.RenderStandard.AddSlantBothPath C# (CSharp) Method

AddSlantBothPath() private static method

private static AddSlantBothPath ( GraphicsPath borderPath, VisualOrientation orientation, Rectangle rect, bool forBorder ) : void
borderPath System.Drawing.Drawing2D.GraphicsPath
orientation VisualOrientation
rect System.Drawing.Rectangle
forBorder bool
return void
        private static void AddSlantBothPath(GraphicsPath borderPath,
                                            VisualOrientation orientation,
                                            Rectangle rect,
                                            bool forBorder)
        {
            // Cache the distance to use for the slant
            int x = _spacingTabSlantPadding;
            int xW = Math.Min(x, rect.Width / 2);
            int xH = Math.Min(x, rect.Height / 2);

            switch (orientation)
            {
                case VisualOrientation.Top:
                    if (!forBorder)
                        borderPath.AddLine(rect.Right, rect.Bottom, rect.Left, rect.Bottom);

                    borderPath.AddLine(rect.Left - 1, rect.Bottom, rect.Left + xW, rect.Top);
                    borderPath.AddLine(rect.Left + xW, rect.Top, rect.Right - xW, rect.Top);
                    borderPath.AddLine(rect.Right - xW, rect.Top, rect.Right, rect.Bottom);
                    break;
                case VisualOrientation.Bottom:
                    if (!forBorder)
                        borderPath.AddLine(rect.Right, rect.Top, rect.Left, rect.Top);

                    borderPath.AddLine(rect.Left - 1, rect.Top, rect.Left + xW, rect.Bottom);
                    borderPath.AddLine(rect.Left + xW, rect.Bottom, rect.Right - xW, rect.Bottom);
                    borderPath.AddLine(rect.Right - xW, rect.Bottom, rect.Right, rect.Top);
                    break;
                case VisualOrientation.Left:
                    if (!forBorder)
                        borderPath.AddLine(rect.Right, rect.Top, rect.Right, rect.Bottom);

                    borderPath.AddLine(rect.Right, rect.Bottom, rect.Left, rect.Bottom - xH);
                    borderPath.AddLine(rect.Left, rect.Bottom - xH, rect.Left, rect.Top + xH);
                    borderPath.AddLine(rect.Left, rect.Top + xH, rect.Right, rect.Top - 1);
                    break;
                case VisualOrientation.Right:
                    if (!forBorder)
                        borderPath.AddLine(rect.Left, rect.Top, rect.Left, rect.Bottom);

                    borderPath.AddLine(rect.Left, rect.Bottom, rect.Right, rect.Bottom - xH);
                    borderPath.AddLine(rect.Right, rect.Bottom - xH, rect.Right, rect.Top + xH);
                    borderPath.AddLine(rect.Right, rect.Top + xH, rect.Left, rect.Top - 1);
                    break;
            }
        }
RenderStandard