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

Make underlines and strikethroughs respect align #226

Conversation

CosmicHorrorDev
Copy link
Collaborator

Resolves #141

@Valentin271 I got a better idea of the underline code after working on #225. The fix feels hacky, but I'm not really familiar with the renderer and there's a lot of messy code in there to begin with 🤷

From what I can gather left gets set to the x coord of the text area including the Align

Demo

(Includes the use of --page-width to check that too)

underline_align.mp4

@CosmicHorrorDev CosmicHorrorDev added C-bug Category: Something isn't working A-font Area: Dealing with font loading/rendering labels Feb 1, 2024
src/text.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@Valentin271 Valentin271 left a comment

Choose a reason for hiding this comment

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

there's a lot of messy code in there to begin with

Yep felt that too.

This does feel a bit hacky to me too. Ideally render_lines would take a CachedTextArea or similar and not every detail about it.
But still this is way better than what I was trying to do on my fork.

@CosmicHorrorDev
Copy link
Collaborator Author

This does feel a bit hacky to me too. Ideally render_lines would take a CachedTextArea or similar and not every detail about it.

Good point! Done and done

Copy link
Contributor

@Valentin271 Valentin271 left a comment

Choose a reason for hiding this comment

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

Looks good to me

@CosmicHorrorDev CosmicHorrorDev merged commit 76e69de into Inlyne-Project:main Feb 2, 2024
9 checks passed
@CosmicHorrorDev CosmicHorrorDev deleted the underline-strikethru-align branch February 2, 2024 23:39
@CosmicHorrorDev CosmicHorrorDev added the C-unreleased-regression Category: A regression that hasn't been released yet label Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-font Area: Dealing with font loading/rendering C-bug Category: Something isn't working C-unreleased-regression Category: A regression that hasn't been released yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Underline alignment regression
2 participants