From f896ad84578bae4ad66fbfb9d33e58c729195e57 Mon Sep 17 00:00:00 2001 From: Rob Parrett Date: Mon, 6 Jan 2025 16:40:00 -0800 Subject: [PATCH] Add builder method for `TextFont::line_height` (#17203) # Objective Followup from #16614 `TextFont` has builder methods for its other fields. Add `with_line_height` for consistency. ## Solution Add it --- crates/bevy_text/src/text.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/bevy_text/src/text.rs b/crates/bevy_text/src/text.rs index 1c0eaa83d8581..06f8adf86c38f 100644 --- a/crates/bevy_text/src/text.rs +++ b/crates/bevy_text/src/text.rs @@ -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 {