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

Support configurable LineHeight in text widgets #1828

Merged
merged 1 commit into from
May 5, 2023

Conversation

hecrj
Copy link
Member

@hecrj hecrj commented May 4, 2023

This PR adds a new configurable line_height attribute to text widgets, replacing the previous hardcoded value (1.2).

Line height can be set using the new LineHeight enum, which has Relative(f32) and Absolute(Pixels) variants.

@hecrj hecrj added feature New feature or request text widget labels May 4, 2023
@hecrj hecrj added this to the 0.10.0 milestone May 4, 2023
Copy link
Contributor

@clarkmoody clarkmoody left a comment

Choose a reason for hiding this comment

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

Great change. No red flags from a quick inspection.

Comment on lines +63 to +71
/// The height of a line of text in a paragraph.
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum LineHeight {
/// A factor of the size of the text.
Relative(f32),

/// An absolute height in logical pixels.
Absolute(Pixels),
}
Copy link
Contributor

Choose a reason for hiding this comment

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

👌

@hecrj hecrj merged commit 7ae549a into advanced-text May 5, 2023
@hecrj hecrj deleted the feature/line-height branch May 5, 2023 04:38
@hecrj hecrj mentioned this pull request May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request text widget
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants