|
|
|
@ -68,11 +68,13 @@ namespace ICSharpCode.TextEditor
@@ -68,11 +68,13 @@ namespace ICSharpCode.TextEditor
|
|
|
|
|
g.FillRectangle(BrushRegistry.GetBrush(textArea.Enabled ? lineNumberPainterColor.BackgroundColor : SystemColors.InactiveBorder), markerRectangle); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int currentLine = textArea.Document.GetFirstLogicalLine(textArea.Document.GetVisibleLine(textArea.TextView.FirstVisibleLine) + y); |
|
|
|
|
int currentLine = textArea.Document.GetFirstLogicalLine(textArea.TextView.FirstPhysicalLine + y); |
|
|
|
|
if (currentLine < textArea.Document.TotalNumberOfLines) { |
|
|
|
|
PaintFoldMarker(g, currentLine, markerRectangle); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool SelectedFoldingFrom(List<FoldMarker> list) |
|
|
|
|
{ |
|
|
|
@ -155,19 +157,22 @@ namespace ICSharpCode.TextEditor
@@ -155,19 +157,22 @@ namespace ICSharpCode.TextEditor
|
|
|
|
|
} else { |
|
|
|
|
if (isFoldEnd) { |
|
|
|
|
int midy = drawingRectangle.Top + drawingRectangle.Height / 2; |
|
|
|
|
|
|
|
|
|
// draw fold end marker
|
|
|
|
|
g.DrawLine(BrushRegistry.GetPen(isEndSelected ? selectedFoldLine.Color : foldLineColor.Color), |
|
|
|
|
xPos, |
|
|
|
|
midy, |
|
|
|
|
xPos + foldMarkerSize / 2, |
|
|
|
|
midy); |
|
|
|
|
|
|
|
|
|
// draw line above fold end marker
|
|
|
|
|
// must be drawn after fold marker because it might have a different color than the fold marker
|
|
|
|
|
g.DrawLine(BrushRegistry.GetPen(isBetweenSelected || isEndSelected ? selectedFoldLine.Color : foldLineColor.Color), |
|
|
|
|
xPos, |
|
|
|
|
drawingRectangle.Top, |
|
|
|
|
xPos, |
|
|
|
|
midy); |
|
|
|
|
|
|
|
|
|
// draw fold end marker
|
|
|
|
|
g.DrawLine(BrushRegistry.GetPen(isBetweenSelected || isEndSelected ? selectedFoldLine.Color : foldLineColor.Color), |
|
|
|
|
xPos, |
|
|
|
|
midy, |
|
|
|
|
xPos + foldMarkerSize / 2, |
|
|
|
|
midy); |
|
|
|
|
// draw line below fold end marker
|
|
|
|
|
if (isBetween) { |
|
|
|
|
g.DrawLine(BrushRegistry.GetPen(isBetweenSelected ? selectedFoldLine.Color : foldLineColor.Color), |
|
|
|
@ -237,7 +242,7 @@ namespace ICSharpCode.TextEditor
@@ -237,7 +242,7 @@ namespace ICSharpCode.TextEditor
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#region Drawing functions
|
|
|
|
|
#region Drawing functions
|
|
|
|
|
void DrawFoldMarker(Graphics g, RectangleF rectangle, bool isOpened, bool isSelected) |
|
|
|
|
{ |
|
|
|
|
HighlightColor foldMarkerColor = textArea.Document.HighlightingStrategy.GetColorFor("FoldMarker"); |
|
|
|
@ -265,6 +270,6 @@ namespace ICSharpCode.TextEditor
@@ -265,6 +270,6 @@ namespace ICSharpCode.TextEditor
|
|
|
|
|
rectangle.Y + rectangle.Height - space); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endregion
|
|
|
|
|
#endregion
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|