Support multiline Texts (#183)

This commit is contained in:
Fabian Würfl 2020-08-25 02:13:24 +02:00 committed by GitHub
parent c78187e6df
commit 7b4bdef77c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}