Skip to content

Commit

Permalink
Support multiline Texts (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
BafDyce committed Aug 25, 2020
1 parent c78187e commit 7b4bdef
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 7b4bdef

Please sign in to comment.