public void Paint(Graphics g, Rectangle rect)
        {
            if (rect.Width <= 0 || rect.Height <= 0)
            {
                return;
            }
            // paint background
            g.FillRectangle(SystemBrushes.Control, new Rectangle(DrawingPosition.X, rect.Top, DrawingPosition.Width - 1, rect.Height));
            g.DrawLine(SystemPens.ControlDark, DrawingPosition.Right - 1, rect.Top, DrawingPosition.Right - 1, rect.Bottom);

            // paint icons
            foreach (Bookmark mark in TextArea.Document.BookmarkManager.Marks)
            {
                int lineNumber = TextArea.Document.GetVisibleLine(mark.LineNumber);
                int lineHeight = TextArea._FontHeight;
                int yPos       = lineNumber * lineHeight - TextArea.VirtualTop.Y;
                if (IsLineInsideRegion(yPos, yPos + lineHeight, rect.Y, rect.Bottom))
                {
                    if (lineNumber == TextArea.Document.GetVisibleLine(mark.LineNumber - 1))
                    {
                        // marker is inside folded region, do not draw it
                        continue;
                    }
                    mark.Draw(this, g, new Point(0, yPos));
                }
            }

            Painted?.Invoke(this, g, rect);
        }
Ejemplo n.º 2
0
 public virtual void Paint(Graphics g, Rectangle rect)
 {
     Painted?.Invoke(this, g, rect);
 }