Skip to content

Commit

Permalink
Support multiline Texts (bevyengine#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
BafDyce authored and BimDav committed Aug 26, 2020
1 parent ccd06de commit 0872245
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/bevy_text/src/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,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;
}

Expand Down

0 comments on commit 0872245

Please sign in to comment.