commit b8d4bb7003edeced1c593215730344c87d0f6ab7
parent 7161997b6ff82cb9f65153d799ffca6720957f25
Author: Samuel Dudik <samuel.dudik@gmail.com>
Date: Sat, 1 Aug 2020 21:34:48 +0200
Add word wrap
Diffstat:
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/config.h b/config.h
@@ -5,7 +5,7 @@ const static char *font_pattern = "Inconsolata:style=Medium:size=13";
const static unsigned line_spacing = 5;
const static unsigned int padding = 15;
-const static unsigned int width = 200;
+const static unsigned int width = 400;
const static unsigned int border_size = 2;
const static unsigned int pos_x = 30;
const static unsigned int pos_y = 50;
diff --git a/herbe.c b/herbe.c
@@ -89,6 +89,11 @@ int main(int argc, char *argv[])
break;
}
+ while (body[eols[num_of_lines - 1] + eol] != ' ')
+ --eol;
+
+ eol++;
+
remainder -= eol;
if (eols_size < num_of_lines + 1)
{