Skip to content

Commit

Permalink
[libgui - Rust] TextView increments cursor to next line via the font’…
Browse files Browse the repository at this point in the history
…s correct line height
  • Loading branch information
codyd51 committed Feb 7, 2024
1 parent de3911d commit b593340
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rust_programs/libgui/src/text_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl TextView {
let mut cursor_pos = cursor_pos;
if ch == '\n' || cursor_pos.x + (font_size.width * 2) >= onto.frame().width() {
cursor_pos.x = 0;
cursor_pos.y += scaled_glyph_metrics.advance_height as isize
cursor_pos.y += font.scaled_line_height(font_size);
} else {
cursor_pos.x += scaled_glyph_metrics.advance_width as isize;
}
Expand Down

0 comments on commit b593340

Please sign in to comment.