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

Implement symmetric text padding from edges #46

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mkhuzaima
Copy link

@mkhuzaima mkhuzaima commented Dec 14, 2024

Username and year are now have same padding from the edges. Padding is kept 10% for now, and, is customizable.

I have used alignment alongwith DrawStringWrapped method, to align username and year on the left and right side of gg.Context respectively.

Fixes #12.

@Copilot Copilot bot review requested due to automatic review settings December 14, 2024 18:46

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

}

yearConfig := textRenderConfig{
renderConfig: renderConfig{
startX: innerWidth * yearPosition,
startX: innerWidth*(1-textPadding) - 75,
Copy link
Author

Choose a reason for hiding this comment

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

By chosing 75, It exaclty aligns with right side of the cuboid.

The number was chosen by hit-and-trial method.

@mkhuzaima mkhuzaima changed the title Implement symmetric text padding from edges for text Implement symmetric text padding from edges Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

[Feature]: Enhance text placement in relation to edges
1 participant