diff options
author | Thomas White <taw@bitwiz.me.uk> | 2019-03-22 00:42:04 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2019-03-22 00:42:04 +0100 |
commit | bf89dce60e148cd7eb12c17984417a18496661da (patch) | |
tree | 92c02aa0ebc26a84c46098ed8d56931bd9cb6a5e /libstorycode/gtk | |
parent | 891e3c9bff47bde012672aa699280400124d2447 (diff) |
Implement slide text paragraph splitting
Diffstat (limited to 'libstorycode/gtk')
-rw-r--r-- | libstorycode/gtk/gtkslideview.c | 15 |
1 files changed, 8 insertions, 7 deletions
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; } |