From 987e5d5d3c332ab7eb0008ce3a4ce6120a17429f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20W=C3=BCrfl?= Date: Fri, 14 Aug 2020 13:30:03 +0200 Subject: [PATCH] Support multiline Texts --- crates/bevy_text/src/draw.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/bevy_text/src/draw.rs b/crates/bevy_text/src/draw.rs index 52fc7127eff4c..241e4cc29252d 100644 --- a/crates/bevy_text/src/draw.rs +++ b/crates/bevy_text/src/draw.rs @@ -83,6 +83,11 @@ impl<'a> Drawable for DrawableText<'a> { // set local per-character bindings for character in self.text.chars() { if character.is_control() { + if character == '\n' { + caret.set_x(self.position.x()); + // TODO: Necessary to also calculate scaled_font.line_gap() in here? + caret.set_y(caret.y() - scaled_font.height()); + } continue; }