Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/Views/TextDiffView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ public override void Render(DrawingContext context)
}

if (indicator != null)
context.DrawText(indicator, new Point(0, y - (indicator.Height * 0.5)));
{
var x = (Bounds.Width - indicator.Width) * 0.5;
context.DrawText(indicator, new Point(x, y - (indicator.Height * 0.5)));
}
}
}
}
Expand All @@ -167,14 +170,21 @@ protected override Size MeasureOverride(Size availableSize)
return new Size(0, 0);

var typeface = TextView.CreateTypeface();
var test = new FormattedText(
var minus = new FormattedText(
"-",
CultureInfo.CurrentCulture,
FlowDirection.LeftToRight,
typeface,
presenter.FontSize,
Brushes.White);
return new Size(test.Width, 0);
var plus = new FormattedText(
"+",
CultureInfo.CurrentCulture,
FlowDirection.LeftToRight,
typeface,
presenter.FontSize,
Brushes.White);
return new Size(Math.Max(minus.Width, plus.Width), 0);
}

protected override void OnDataContextChanged(EventArgs e)
Expand Down