From 25c7cb2c23551b6baa70ad6642602c30ecc1a7b7 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 5 Oct 2019 09:59:17 +0200 Subject: narrative_pos_trail_to_offset: Consider end of run as within run --- libstorycode/narrative_render_cairo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstorycode/narrative_render_cairo.c b/libstorycode/narrative_render_cairo.c index 9faacf7..53011cd 100644 --- a/libstorycode/narrative_render_cairo.c +++ b/libstorycode/narrative_render_cairo.c @@ -206,7 +206,7 @@ size_t narrative_pos_trail_to_offset(Narrative *n, int i, int offs, int trail) pos = 0; for ( run=0; runn_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, -- cgit v1.2.3