Checked empty strings on Pango.

This commit is contained in:
Pietro Gagliardi 2017-02-24 21:42:40 -05:00
parent c4400b83f3
commit 3d5fbc0880
2 changed files with 3 additions and 1 deletions

View File

@ -207,7 +207,7 @@ void uiDrawText(uiDrawContext *c, uiDrawTextLayout *tl, double x, double y)
} }
// TODO document that the width and height of a layout is not necessarily the sum of the widths and heights of its constituent lines // TODO document that the width and height of a layout is not necessarily the sum of the widths and heights of its constituent lines
// TODO width doesn't include trailing whitespace... (TODO on which platforms?) // TODO width doesn't include trailing whitespace...
// TODO figure out how paragraph spacing should play into this // TODO figure out how paragraph spacing should play into this
void uiDrawTextLayoutExtents(uiDrawTextLayout *tl, double *width, double *height) void uiDrawTextLayoutExtents(uiDrawTextLayout *tl, double *width, double *height)
{ {

View File

@ -4,11 +4,13 @@
// TODO // TODO
// - if the RTL override is at the beginning of a line, the preceding space is included? // - if the RTL override is at the beginning of a line, the preceding space is included?
// - nLines == 0: mostly works, except the width is wrong if the paragraph alignment is center or right...
struct uiDrawTextLayout { struct uiDrawTextLayout {
PangoLayout *layout; PangoLayout *layout;
GPtrArray *backgroundClosures; GPtrArray *backgroundClosures;
uiDrawTextLayoutLineMetrics *lineMetrics; uiDrawTextLayoutLineMetrics *lineMetrics;
// TODO change everything to use this
int nLines; int nLines;
}; };