Restore handling of bullets for lists with a font size of > 36 pixels

This patch partially reverts ad443dfb1d,
the test that was added is still there as it can be used to compare
against Chrome and to check that indenting works correctly.

The original behavior of clipping the bullets is correct because the
specified indent is where the text itself should be positioned, the bullet
uses the available space to the side of it. This is how other web browsers
handle the same situation.

Change-Id: I63440e037d8efec356459c09228ef4817ccb9cb6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
This commit is contained in:
Andy Shaw 2013-10-14 13:26:03 +02:00 committed by The Qt Project
parent d4d96c375d
commit 1f01ac8323

View File

@ -1427,19 +1427,6 @@ void QTextDocumentLayoutPrivate::drawListItem(const QPointF &offset, QPainter *p
xoff = -xoff - size.width();
r.translate( xoff, (fontMetrics.height() / 2) - (size.height() / 2));
// Prevent clipping the left side of the list decorator (on left to
// right layouts) and clipping the right side of the list
// decorator (on right to left layouts).
if ((r.left() < 0) && (dir == Qt::LeftToRight)) {
int horizontalOffset = -r.left();
r.translate(horizontalOffset, 0);
layout->setPosition(layout->position() + QPointF(horizontalOffset, 0));
} else if ((r.right() > document->pageSize().width()) && (dir == Qt::RightToLeft)) {
int horizontalOffset = r.right() - document->pageSize().width();
r.translate(-horizontalOffset, 0);
layout->setPosition(layout->position() - QPointF(horizontalOffset, 0));
}
painter->save();
painter->setRenderHint(QPainter::Antialiasing);