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

Update watchface_digital.cpp #62

Merged
merged 2 commits into from
May 5, 2021

Conversation

rawsignal
Copy link
Contributor

Correcting an issue where if the step count was too low (or presumably too high) the centering would be incorrect. It should now be dynamic and tested up to a step count of 5 digits, as low as 1, to ensure centering works as expected.

Correcting an issue where if the step count was too low (or presumably too high) the centering would be incorrect. It should now be dynamic and tested up to a step count of 5 digits, as low as 1, to ensure centering works as expected.
@rawsignal
Copy link
Contributor Author

numPositiveDigits could be useful as a helper somewhere, not sure where we could put it though

hal->gfx()->setTextSize(2);
hal->gfx()->setTextCursor(((220/2)-defaultFontXOffset(1, 2)), 210 - defaultFontYOffset(1, 2) / 2);
hal->gfx()->setTextCursor(120 - hal->gfx()->getTextOfsetColumns(width/2), 210 - defaultFontYOffset(1, 2) / 2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better: setTextCenterAligned(), then we don't need the numPositiveDigits.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use setTextCenterAligned and tested working great

Using setTextCenterAligned for center aligning the text
@rawsignal rawsignal requested a review from uvwxy May 5, 2021 12:50
@uvwxy uvwxy merged commit b318977 into Open-Smartwatch:master May 5, 2021
RuffaloLavoisier pushed a commit to RuffaloLavoisier/Ruffalo-OSW that referenced this pull request Apr 27, 2022
…t-centering

Update watchface_digital.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants