Only apply first line indent to left-aligned and justified layouts

This commit is contained in:
Slava Monich 2015-07-04 00:32:15 +03:00
parent b704fb1289
commit eb5928a5ba

View file

@ -124,8 +124,11 @@ ZLTextLineInfoPtr ZLTextArea::processTextLine(Style &style, const ZLTextWordCurs
const ZLTextStyleEntry::Metrics metrics(fontSize, fontSize / 2, width(), height()); const ZLTextStyleEntry::Metrics metrics(fontSize, fontSize / 2, width(), height());
info.StartIndent = style.textStyle()->lineStartIndent(metrics, isRtl()); info.StartIndent = style.textStyle()->lineStartIndent(metrics, isRtl());
if (isFirstLine) { if (isFirstLine) {
const ZLTextAlignmentType align = style.textStyle()->alignment();
if (align == ALIGN_LEFT || align == ALIGN_JUSTIFY) {
info.StartIndent += style.textStyle()->firstLineIndentDelta(metrics); info.StartIndent += style.textStyle()->firstLineIndentDelta(metrics);
} }
}
if (!info.NodeInfo.isNull()) { if (!info.NodeInfo.isNull()) {
info.StartIndent += (context().stringHeight() + 2) / 3 * 4 * (info.NodeInfo->VerticalLinesStack.size() + 1); info.StartIndent += (context().stringHeight() + 2) / 3 * 4 * (info.NodeInfo->VerticalLinesStack.size() + 1);
} }