Skip to content

Support configurable LineHeight in text widgets#1828

Merged
hecrj merged 1 commit intoadvanced-textfrom
feature/line-height
May 5, 2023
Merged

Support configurable LineHeight in text widgets#1828
hecrj merged 1 commit intoadvanced-textfrom
feature/line-height

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