Exemple #1
0
void Paragraph::breakLines(le_int32 width, le_int32 height)
{
    fHeight = height;

    // don't re-break if the width hasn't changed
    if (fWidth == width) {
        return;
    }

    fWidth  = width;

    float lineWidth = (float) (width - 2 * MARGIN);
    const ParagraphLayout::Line *line;

    // Free the old LineInfo's...
    for (le_int32 li = 0; li < fLineCount; li += 1) {
        delete fLines[li];
    }

    fLineCount = 0;

    for (le_int32 p = 0; p < fParagraphCount; p += 1) {
        ParagraphLayout *paragraphLayout = fParagraphLayout[p];

        if (paragraphLayout != NULL) {
            paragraphLayout->reflow();
            while ((line = paragraphLayout->nextLine(lineWidth)) != NULL) {
                addLine(line);
            }
        } else {
            addLine(NULL);
        }
    }
}
Exemple #2
0
U_CAPI pl_line * U_EXPORT2
pl_nextLine(pl_paragraph *paragraph, float width)
{
    ParagraphLayout *pl = (ParagraphLayout *) paragraph;

    if (pl == NULL) {
        return NULL;
    }

    return (pl_line *) pl->nextLine(width);
}
Exemple #3
0
	ParagraphLayouter::Line *NextLine(int max_width)
	{
		ParagraphLayout::Line *l = p->nextLine(max_width);
		return l == NULL ? NULL : new ICULine(l);
	}