diff options
author | Thomas White <taw@bitwiz.org.uk> | 2016-01-25 18:48:40 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2016-01-25 18:48:40 +0100 |
commit | 86f4ccb39fd02d25c98201e56dfdc2f105ee0c75 (patch) | |
tree | ec843a205a68a51cec8385f68699df7920ac7312 /src/sc_editor.c | |
parent | e960f56772d7b94349038efa1d733b6759eeefda (diff) |
WIP on box upgrades
Diffstat (limited to 'src/sc_editor.c')
-rw-r--r-- | src/sc_editor.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c index ddfe2df..48235c2 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -855,7 +855,17 @@ static void insert_text(char *t, SCEditor *e) if ( sbox->type == WRAP_BOX_NOTHING ) { printf("Upgrading nothing box to Pango box\n"); - return; + sbox->type = WRAP_BOX_PANGO; + sbox->col[0] = 0.0; + sbox->col[1] = 0.0; + sbox->col[2] = 0.0; + sbox->col[3] = 0.0; + sbox->n_segs = 1; + sbox->segs = malloc(sizeof(struct text_seg)); + sbox->len_chars = 0; + sbox->segs[0].glyphs = NULL; + sbox->segs[0].offs_char = sbox->offs_char; + sbox->segs[0].len_chars = 0; } sseg = which_segment(sbox, sps, &err); @@ -885,6 +895,8 @@ static void insert_text(char *t, SCEditor *e) struct wrap_box *nbox; + printf("Adding line break\n"); + /* Add a new box containing the text after the break */ insert_box(&e->cursor_frame->lines[sln], sbx); nbox = &e->cursor_frame->lines[sln].boxes[sbx]; |