From 9c8bbbf362beca4fd4268334704a790568e6bd51 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 6 Oct 2020 11:11:12 +0200 Subject: Added newline at overflow --- apps/window.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apps/window.c') diff --git a/apps/window.c b/apps/window.c index 6309e51..208c4d4 100644 --- a/apps/window.c +++ b/apps/window.c @@ -45,6 +45,11 @@ int main() if (!event->press) break; + if (char_x * font_width >= (int)win.width) { + char_y++; + char_x = 0; + } + if (ch == '\n') { char_x = 0; char_y++; -- cgit v1.2.3