Style.GetFrameSize()
does not account for border when using only BorderStyle()
#281
Labels
Style.GetFrameSize()
does not account for border when using only BorderStyle()
#281
Describe the bug
When rendering, a style configured with
BorderStyle(border)
renders the same as usingBorder(border)
with nosides
arguments, thanks to this check inapplyBorder()
:However, the border sizes reported from
GetHorizontalBorderSize()
,GetVerticalBorderSize()
,GetHorizontalFrameSize()
, andGetVerticalFrameSize()
are not adjusted when usingBorderStyle()
. I'm new to the Bubbletea ecosystem and have been trying to use these functions to calculate content sizes, and kept getting frames that exceeded the intended size without understanding why.To Reproduce
The final test fails with these errors:
Expected behavior
Given that
BorderStyle(border)
renders the same asBorder(border)
, I would expect methods that calculate border / frame sizes to return the same sizes as when usingBorder()
.This could be resolved in several different ways:
applyBorder
, under the same conditions. This is probably the safest option.BorderStyle
explicitly set all border sides to visible if none of the border side keys have been set yet. This might be risky depending on whether somebody is using inherited styles, and in what order they set their style properties.This last approach could also risk changing behavior for existing applications, if they are relying on explicit calls like
BorderLeft(true)
to turn on border sizes.The text was updated successfully, but these errors were encountered: