Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Terminal.Gui/Core/TextFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1190,8 +1190,8 @@ public void Draw (Rect bounds, Attribute normalColor, Attribute hotColor, Rect c
for (int line = 0; line < linesFormated.Count; line++) {
if ((isVertical && line > bounds.Width) || (!isVertical && line > bounds.Height))
continue;
if ((isVertical && line >= maxBounds.Left + maxBounds.Width - 1)
|| (!isVertical && line >= maxBounds.Top + maxBounds.Height - 1))
if ((isVertical && line >= maxBounds.Left + maxBounds.Width)
|| (!isVertical && line >= maxBounds.Top + maxBounds.Height))

break;

Expand Down
27 changes: 27 additions & 0 deletions UnitTests/Views/ViewTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using NStack;
using System;
using Terminal.Gui.Graphs;
using Xunit;
using Xunit.Abstractions;
//using GraphViewTests = Terminal.Gui.Views.GraphViewTests;
Expand Down Expand Up @@ -4489,5 +4490,31 @@ A text with some long width
A text with some long width
A text witith two lines. ", output);
}

[Fact, AutoInitShutdown]
public void Test_Nested_Views_With_Height_Equal_To_One ()
{
var v = new View () { Width = 11, Height = 3, ColorScheme = new ColorScheme () };

var top = new View () { Width = Dim.Fill (), Height = 1 };
var bottom = new View () { Width = Dim.Fill (), Height = 1, Y = 2 };

top.Add (new Label ("111"));
v.Add (top);
v.Add (new LineView (Orientation.Horizontal) { Y = 1 });
bottom.Add (new Label ("222"));
v.Add (bottom);

v.LayoutSubviews ();
v.Redraw (v.Bounds);


string looksLike =
@"
111
───────────
222";
TestHelpers.AssertDriverContentsAre (looksLike, output);
}
}
}