From bf89dce60e148cd7eb12c17984417a18496661da Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 22 Mar 2019 00:42:04 +0100 Subject: Implement slide text paragraph splitting --- libstorycode/gtk/gtkslideview.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'libstorycode/gtk/gtkslideview.c') diff --git a/libstorycode/gtk/gtkslideview.c b/libstorycode/gtk/gtkslideview.c index f3d7d59..913fd56 100644 --- a/libstorycode/gtk/gtkslideview.c +++ b/libstorycode/gtk/gtkslideview.c @@ -970,13 +970,14 @@ static void insert_text(char *t, GtkSlideView *e) } if ( strcmp(t, "\n") == 0 ) { - //split_paragraph_at_cursor(n, e->cpos); - //rewrap_range(e, e->cpos.para, e->cpos.para+1); - //update_size(e); - //cursor_moveh(n, &e->cpos, +1); - //check_cursor_visible(e); - //emit_change_sig(e); - //redraw(e); + off = pos_trail_to_offset(e->cursor_frame, e->cpos.para, + e->cpos.pos, e->cpos.trail); + slide_item_split_text_paragraph(e->cursor_frame, e->cpos.para, off); + e->cpos.para++; + e->cpos.pos = 0; + e->cpos.trail = 0; + emit_change_sig(e); + redraw(e); return; } -- cgit v1.2.3