mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08: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._hitBoxes.Clear();
|
||||||
c._lastHitIdx = -1;
|
c._lastHitIdx = -1;
|
||||||
c.InvalidateVisual();
|
c.InvalidateMeasure();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Render(DrawingContext context)
|
public override void Render(DrawingContext context)
|
||||||
{
|
{
|
||||||
if (Samples == null)
|
if (Samples == null || Bounds.Width == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var samples = Samples;
|
var samples = Samples;
|
||||||
|
@ -97,7 +97,7 @@ namespace SourceGit.Views
|
||||||
var height = Bounds.Height;
|
var height = Bounds.Height;
|
||||||
|
|
||||||
// Transparent background to block mouse move events.
|
// 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
|
// Draw coordinate
|
||||||
var maxLabel = new FormattedText($"{maxV}", CultureInfo.CurrentCulture, FlowDirection.LeftToRight, typeface, 12.0, LineBrush);
|
var maxLabel = new FormattedText($"{maxV}", CultureInfo.CurrentCulture, FlowDirection.LeftToRight, typeface, 12.0, LineBrush);
|
||||||
|
|
Loading…
Reference in a new issue