From 1f01ac832346fb217e7c07452673cd5f66cf4835 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 14 Oct 2013 13:26:03 +0200 Subject: Restore handling of bullets for lists with a font size of > 36 pixels This patch partially reverts ad443dfb1d8e9096c4913686aa2ed0bc9b3f5de7, 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 --- src/gui/text/qtextdocumentlayout.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src/gui/text/qtextdocumentlayout.cpp') diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp index 6156f56ae1..313700429c 100644 --- a/src/gui/text/qtextdocumentlayout.cpp +++ b/src/gui/text/qtextdocumentlayout.cpp @@ -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); -- cgit v1.2.3