Fixed ruler alignment on MacOS for fonts with fractional metrics.

Task-number: QTCREATORBUG-1065
Reviewed-by: mae
This commit is contained in:
Erik Verbruggen
2010-04-12 15:37:08 +02:00
parent be0dfb8cfc
commit fbb8f39945

View File

@@ -2989,13 +2989,13 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
QTextBlock block = firstVisibleBlock();
int blockNumber = block.blockNumber();
int top = (int) blockBoundingGeometry(block).translated(contentOffset()).top();
int bottom = top;
qreal top = blockBoundingGeometry(block).translated(contentOffset()).top();
qreal bottom = top;
while (block.isValid() && top <= e->rect().bottom()) {
top = bottom;
bottom = top + (int)blockBoundingRect(block).height();
bottom = top + blockBoundingRect(block).height();
QTextBlock nextBlock = block.next();
QTextBlock nextVisibleBlock = nextBlock;