bczsalba / pytermgui

Python TUI framework with mouse support, modular widget system, customizable and rapid terminal markup language and more!
https://ptg.bczsalba.com
MIT License
2.23k stars 54 forks source link

[BUG] Splitter doesn't use the full width in some configurations #8

Closed bczsalba closed 2 years ago

bczsalba commented 2 years ago

Describe the bug The pytermgui.widgets.extra.Splitter class doesn't use the full width on some size configurations, and it becomes 1 character too thin on either odd or even width numbers.

To Reproduce

  1. Create a Window
  2. Add a Splitter with at least two elements
  3. Try resizing the Window while the program is running

Expected behavior Splitter width should stay the same, regardless of whether the width is even or odd.

System information

PyTermGUI v1.0.1
Python: 3.9.9
Platform: macOS-12.0.1-arm64-arm-64bit
Git commit: ec879a5

Possible cause The math behind the Splitter width distributions has a bug.

Possible solution Fixing the Splitter width distribution math.