narrative_pos_trail_to_offset: Consider end of run as within run
authorThomas White <taw@physics.org>
Sat, 5 Oct 2019 07:59:17 +0000 (09:59 +0200)
committerThomas White <taw@physics.org>
Sat, 5 Oct 2019 15:03:43 +0000 (17:03 +0200)
libstorycode/narrative_render_cairo.c

index 9faacf7..53011cd 100644 (file)
@@ -206,7 +206,7 @@ size_t narrative_pos_trail_to_offset(Narrative *n, int i, int offs, int trail)
        pos = 0;
        for ( run=0; run<item->n_runs; run++ ) {
                pos += strlen(item->runs[run].text);
-               if ( pos > offs ) {
+               if ( pos >= offs ) {
                        glong char_offs;
                        char *ptr;
                        char_offs = g_utf8_pointer_to_offset(item->runs[run].text,