diff options
author | Thomas White <taw@bitwiz.org.uk> | 2015-11-26 09:55:46 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2015-11-26 09:55:46 +0100 |
commit | 3cbb8d0124e839136795ae8dcf475a5fbe86c093 (patch) | |
tree | b3ddeed8d286b0b986338e29850c040a23ca1216 /src/wrap.c | |
parent | 81100c4e659c6b11f2e36f48a171325ddff76676 (diff) |
WIP
Diffstat (limited to 'src/wrap.c')
-rw-r--r-- | src/wrap.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -1038,3 +1038,24 @@ double total_height(struct frame *fr) return pango_units_to_double(tot); } + + +/* Insert a new box, which will be at position 'pos' */ +int insert_box(struct wrap_line *l, int pos) +{ + int i; + + if ( l->n_boxes == l->max_boxes ) { + l->max_boxes += 32; + if ( alloc_boxes(l) ) return 1; + } + + /* Shuffle the boxes along */ + for ( i=l->n_boxes; i>pos+1; i-- ) { + l->boxes[i] = l->boxes[i-1]; + } + + l->n_boxes++; + + return 0; +} |