Open jacksonstone-fs opened 2 weeks ago
Latest commit: 9a3e957ff9bffc22797eec75d6ad97a9cc61b435
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
fix #62
This PR aims to fix misalignment in certain circumstances when using center and right aligned text. Because the floor of the number of spaces the column had available wasn't taken for right and center as it was for left, these columns had a tendency to overflow and cause extra newlines.
This is fixed by taking the floor of
cellWidth - textLength
for right aligned text, and handling fractional components by taking the ceiling for the left side and floor for the right side for center aligned text. This keeps the previous convention of preferring extra space on the left instead of right for center aligned text.An example of bad parameters that would cause issues before this PR for testing purposes is
cellWidth = 4.2
andtextLength = 2
.