URI: 
       tFix wrapping (was off by a few pixels) - ltkx - GUI toolkit for X11 (WIP)
  HTML git clone git://lumidify.org/ltkx.git
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 9c62c13ad2f58414b7de5dd1b928c9dd780df8cc
   DIR parent 6dd04b169616da62128fa4e952b005d6139c9100
  HTML Author: lumidify <nobody@lumidify.org>
       Date:   Thu, 21 May 2020 22:09:45 +0200
       
       Fix wrapping (was off by a few pixels)
       
       Diffstat:
         M text_buffer.c                       |       7 ++++---
       
       1 file changed, 4 insertions(+), 3 deletions(-)
       ---
   DIR diff --git a/text_buffer.c b/text_buffer.c
       t@@ -127,8 +127,6 @@ ltk_text_line_wrap(struct ltk_text_line *tl, int max_width) {
                                        glyph = &cur->glyphs[i];
                                        int cur_w = sl->w + cur_start - glyph->x_abs;
                                        if (cur_w > max_width) {
       -                                        /* FIXME: fix behavior when line isn't wide enough for single char
       -                                           (currently causes infinite loop) */
                                                for (int j = i; j < cur->num_glyphs; j++) {
                                                        if (cur->glyphs[j].cluster != glyph->cluster ||
                                                            j == cur->num_glyphs - 1 || sl->len == 0) {
       t@@ -172,7 +170,10 @@ ltk_text_line_wrap(struct ltk_text_line *tl, int max_width) {
                                int i = 0;
                                while (i < cur->num_glyphs) {
                                        glyph = &cur->glyphs[i];
       -                                int cur_w = sl->w + glyph->x_abs + glyph->info->w - cur_start;
       +                                /* FIXME: This uses x_advance instead of glyph width so it works correctly
       +                                   together with the current shaping, but should it maybe take the largest
       +                                   of the two? What if the glyph width is actually larger than x_advance? */
       +                                int cur_w = sl->w + glyph->x_abs + glyph->x_advance - cur_start;
                                        if (cur_w > max_width) {
                                                for (int j = i; j >= 0; j--) {
                                                        if (cur->glyphs[j].cluster != glyph->cluster ||