-
Notifications
You must be signed in to change notification settings - Fork 633
Fix incorrect panel height calculation in complex layout #1514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
20a2f72
4f22f5b
a62e799
d52d14e
444dbed
00b9aec
bc88da8
3eb620a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| ┌──────────────────┐┌──────────────────┐ | ||
| │ Hello, World! ││ Hello, World! │ | ||
| │ ││ │ | ||
| │ ││ │ | ||
| └──────────────────┘│ │ | ||
| ┌──────────────────┐│ │ | ||
| │ Hello, World! ││ │ | ||
| │ ││ │ | ||
| │ ││ │ | ||
| │ ││ │ | ||
| └──────────────────┘│ │ | ||
| ┌──────────────────┐│ │ | ||
| │ Hello, World! ││ │ | ||
| │ ││ │ | ||
| │ ││ │ | ||
| │ ││ │ | ||
| └──────────────────┘└──────────────────┘ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -264,4 +264,37 @@ public Task Should_Fall_Back_To_Parent_Layout_If_All_Children_Are_Invisible() | |
| // Then | ||
| return Verifier.Verify(console.Output); | ||
| } | ||
|
|
||
| [Fact] | ||
| [Expectation("Render_Layout_With_Three_And_One_Columns")] | ||
|
||
| public Task Should_Render_Layout_With_Three_And_One_Columns() | ||
|
||
| { | ||
| // Given | ||
| var console = new TestConsole().Size(new Size(40, 17)); | ||
| var layout = new Layout(); | ||
| var col1 = new Layout(); | ||
| var col1Row1 = new Layout(); | ||
| var col1Row2 = new Layout(); | ||
| var col1Row3 = new Layout(); | ||
|
|
||
| col1.SplitRows(col1Row1, col1Row2, col1Row3); | ||
|
|
||
| var col2 = new Layout(); | ||
|
|
||
| layout.SplitColumns(col1, col2); | ||
|
|
||
| var panel = new Panel("Hello, World!") { Expand = true }; | ||
|
|
||
| List<Layout> layouts = [col1Row1, col1Row2, col1Row3, col2]; | ||
| foreach (var l in layouts) | ||
| { | ||
| l.Update(panel); | ||
| } | ||
|
||
|
|
||
| // When | ||
| console.Write(layout); | ||
|
|
||
| // Then | ||
| return Verifier.Verify(console.Output); | ||
| } | ||
| } | ||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make this a [Theory] and pass in the problematic console heights 17, 20, 23, 28, 31 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!