Fix maxWidth bug in Panel

Panel could pass a maxWidth to the child Render function that was greater than the maxWidth that was passed to the Panel render function.
I noticed this when trying to nest a table in a panel and the word wrapping was being disabled.

N.B It might be that Table.Measure ought to not return a measurment larger than maxWidth, but this Panel change seems defensivly sensible regardless.
This commit is contained in:
Fraser Waters
2021-04-22 18:11:05 +01:00
committed by Patrik Svensson
parent 79af013bf2
commit 91f910326c
3 changed files with 38 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
╔════════════════════════════╗
║ ┌────────┬───────┬───────┐ ║
║ │ Foo │ Bar │ Baz │ ║
║ ├────────┼───────┼───────┤ ║
║ │ Qux │ Corgi │ Waldo │ ║
║ │ With A │ │ │ ║
║ │ Long │ │ │ ║
║ │ Descri │ │ │ ║
║ │ ption │ │ │ ║
║ │ Grault │ Garpl │ Fred │ ║
║ │ │ y │ On A │ ║
║ │ │ │ Long │ ║
║ │ │ │ Long │ ║
║ │ │ │ Walk │ ║
║ └────────┴───────┴───────┘ ║
╚════════════════════════════╝