diff options
author | Thomas White <taw@bitwiz.org.uk> | 2015-10-19 20:16:46 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2015-10-19 20:16:46 +0100 |
commit | d2d1cee6c1ba37cead7576f1e6bd721d54f7f210 (patch) | |
tree | 7e3ce9efdb17dd3c6c5feba5234ef8966cdd3661 | |
parent | 054ad480afb29ca166979337b266c9c64a666e6a (diff) |
Add total_height()
-rw-r--r-- | src/wrap.c | 15 | ||||
-rw-r--r-- | src/wrap.h | 1 |
2 files changed, 16 insertions, 0 deletions
@@ -1023,3 +1023,18 @@ int wrap_contents(struct frame *fr) return 0; } + + +double total_height(struct frame *fr) +{ + int i; + double tot = 0.0; + + if ( fr == NULL ) return 0.0; + + for ( i=0; i<fr->n_lines; i++ ) { + tot += fr->lines[i].height; + } + + return pango_units_to_double(tot); +} @@ -121,5 +121,6 @@ extern void initialise_line(struct wrap_line *l); extern void wrap_line_free(struct wrap_line *l); extern void show_boxes(struct wrap_line *boxes); +extern double total_height(struct frame *fr); #endif /* WRAP_H */ |