Skip to content

Commit

Permalink
Add builder method for TextFont::line_height (#17203)
Browse files Browse the repository at this point in the history
# Objective

Followup from #16614

`TextFont` has builder methods for its other fields. Add
`with_line_height` for consistency.

## Solution

Add it
  • Loading branch information
rparrett authored Jan 7, 2025
1 parent fbc55b8 commit f896ad8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/bevy_text/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,12 @@ impl TextFont {
self.font_smoothing = font_smoothing;
self
}

/// Returns this [`TextFont`] with the specified [`LineHeight`].
pub const fn with_line_height(mut self, line_height: LineHeight) -> Self {
self.line_height = line_height;
self
}
}

impl Default for TextFont {
Expand Down

0 comments on commit f896ad8

Please sign in to comment.