Skip to content

Commit

Permalink
remove gap between indent lines #28 (#29)
Browse files Browse the repository at this point in the history
* remove gap between indent lines #28

* Fix missing import, code cleanup

Co-authored-by: Marcel Wagner <[email protected]>
  • Loading branch information
ta5n and marcelwgn authored Nov 7, 2022
1 parent f360b23 commit 4045596
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/IndentRainbow.Extension/Drawing/BackgroundTextIndexDrawer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows.Controls;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using IndentRainbow.Logic.Drawing;
using Microsoft.VisualStudio.Text;
Expand Down Expand Up @@ -28,7 +29,15 @@ public void DrawBackground(int firstIndex, int length, Brush drawBrush)
Geometry geometry = view.TextViewLines.GetMarkerGeometry(span);
if (geometry != null)
{
var drawing = new GeometryDrawing(drawBrush, null, geometry);
var newRect = new Rect()
{
X = geometry.Bounds.X,
Y = geometry.Bounds.Y,
Width = geometry.Bounds.Width,
Height = view.LineHeight
};
var copiedGeometry = new RectangleGeometry(newRect);
var drawing = new GeometryDrawing(drawBrush, null, copiedGeometry);
drawing.Freeze();

var drawingImage = new DrawingImage(drawing);
Expand Down

0 comments on commit 4045596

Please sign in to comment.