Skip to content
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

fix: alignCenter (#115) #116

Merged
merged 1 commit into from
Jul 30, 2020
Merged

fix: alignCenter (#115) #116

merged 1 commit into from
Jul 30, 2020

Conversation

michaelgwelch
Copy link
Contributor

@michaelgwelch michaelgwelch commented Jul 30, 2020

The method for alignCenter is checking
to see if halfWidth (rather than width)
is even. This worked with the existing test
case because the container width given is 6
minus string width (2) is 4. Divide that in half
and you have an even number.

My test case makes the container width 8.
So available width is 6. Divide that in half
you get an odd number. So the odd logic triggers
padding 3 to the left and 4 to the right.

This commit fixes the minor defect.

Fixes #115

The method for alignCenter is checking
to see if halfWidth (rather than width)
is even. This worked with the existing test
case because the container width given is 6
minus string width (2) is 4. Divide that in half
and you have an even number.

My test case makes the container width 8.
So available width is 6. Divide that in half
you get an odd number. So the odd logic triggers
padding 3 to the left and 4 to the right.

This commit fixes the minor defect.
@coveralls
Copy link

coveralls commented Jul 30, 2020

Pull Request Test Coverage Report for Build 194

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 72.948%

Totals Coverage Status
Change from base Build 193: 0.0%
Covered Lines: 172
Relevant Lines: 236

💛 - Coveralls

@michaelgwelch
Copy link
Contributor Author

I don't know how to get your build to pass. But you can use the test case as you wish to demonstrate the defect to yourself.

@gajus gajus merged commit fc2c35b into gajus:master Jul 30, 2020
@gajus
Copy link
Owner

gajus commented Aug 30, 2020

🎉 This PR is included in version 6.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minor defect in alignCenter logic
3 participants