mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-10-31 13:03:20 -07:00
fix: skip to render contents when Bounds.Width is zero
This commit is contained in:
parent
bd09a44ab9
commit
0596a63b30
1 changed files with 3 additions and 3 deletions
|
@ -45,13 +45,13 @@ namespace SourceGit.Views
|
|||
{
|
||||
c._hitBoxes.Clear();
|
||||
c._lastHitIdx = -1;
|
||||
c.InvalidateVisual();
|
||||
c.InvalidateMeasure();
|
||||
});
|
||||
}
|
||||
|
||||
public override void Render(DrawingContext context)
|
||||
{
|
||||
if (Samples == null)
|
||||
if (Samples == null || Bounds.Width == 0)
|
||||
return;
|
||||
|
||||
var samples = Samples;
|
||||
|
@ -97,7 +97,7 @@ namespace SourceGit.Views
|
|||
var height = Bounds.Height;
|
||||
|
||||
// Transparent background to block mouse move events.
|
||||
context.DrawRectangle(Brushes.Transparent, null, new Rect(0, 0, Bounds.Width, Bounds.Height));
|
||||
context.DrawRectangle(Brushes.Transparent, null, new Rect(0, 0, width, height));
|
||||
|
||||
// Draw coordinate
|
||||
var maxLabel = new FormattedText($"{maxV}", CultureInfo.CurrentCulture, FlowDirection.LeftToRight, typeface, 12.0, LineBrush);
|
||||
|
|
Loading…
Reference in a new issue