Posted 18 years ago
by Thomas Goff
Version: 4.0.0253
Platform: .NET 2.0
Environment: Windows XP (32-bit)

If you add the following code to the end of the MainForm constructor in your sample you will see that the span indicator does not properly draw. If you move the span indicator so it does not end on an empty line, then it draws fine.
// Set text
editor.Text = "This is a test\nof span indicators that end\non a blank line\n\n\nMore text outside the span indicator\n\n";
// Create highlight style
HighlightingStyle highlightingStyle = new HighlightingStyle("style", null, Color.Empty, Color.Empty);
highlightingStyle.BorderColor = Color.Black;
highlightingStyle.BorderStyle = HighlightingStyleLineStyle.Solid;
// Create a layer
SpanIndicatorLayer layer = new SpanIndicatorLayer("test", 1);
editor.Document.SpanIndicatorLayers.Add(layer);
// Get the lines that will be in the span indicator
DocumentLine startLine = editor.Document.Lines[0];
DocumentLine endLine = editor.Document.Lines[3];
// Get the text range for the lines
TextRange textRange = new TextRange(startLine.StartOffset, endLine.EndOffset);
// Create a highlight span indicator
HighlightingStyleSpanIndicator indicator = new HighlightingStyleSpanIndicator("indicator",
highlightingStyle);
layer.Add(indicator, textRange);