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 7 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 5% 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.

stl/geometry/text.go Outdated Show resolved Hide resolved
@mkhuzaima mkhuzaima changed the title Implement symmetric text padding from edges for text Implement symmetric text padding from edges Dec 14, 2024
@chrisreddington
Copy link
Collaborator

Thanks @mkhuzaima for the contribution, it's appreciated! ✨ And your patience for me to review!

I've been taking a look through, and it looks like a great start! I've been thinking about an additional tweak that could be made (I realised I wasn't as clear as I could have been in my original issue!)

I think we're looking to balance the space between the Invertocat on the left hand edge with the text on the right hand edge. In the current implementation, the distance between left edge and username is the same as the right edge and year, it looks a little unbalanced compared to the left hand side.

So perhaps something like, the distances between these items should be the same:

  1. Left edge to the left of the invertocat logo
  2. Right of the invertocat logo to the left of the username
  3. Right of the year text to the right edge
image

What do you think? 😄

@mkhuzaima
Copy link
Author

Thanks @mkhuzaima for the contribution, it's appreciated! ✨ And your patience for me to review!

I've been taking a look through, and it looks like a great start! I've been thinking about an additional tweak that could be made (I realised I wasn't as clear as I could have been in my original issue!)

I think we're looking to balance the space between the Invertocat on the left hand edge with the text on the right hand edge. In the current implementation, the distance between left edge and username is the same as the right edge and year, it looks a little unbalanced compared to the left hand side.

So perhaps something like, the distances between these items should be the same:

  1. Left edge to the left of the invertocat logo
  2. Right of the invertocat logo to the left of the username
  3. Right of the year text to the right edge
image

What do you think? 😄

Thanks so much for reviewing my contribution and for the thoughtful feedback—I really appreciate it! 😊

I see what you mean about balancing the spacing to make it feel more consistent. That’s a great idea, and I’ll work on tweaking it to align better with what you described. I’ll update the PR as soon as I’ve got it sorted!

Thanks again for your time and guidance—it’s been great working on this!

@mkhuzaima mkhuzaima requested a review from Copilot December 28, 2024 15:55

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

[Feature]: Enhance text placement in relation to edges
2 participants