fix: Line numbers for problem case input/output/expected texteditors are not vertically centered.
This commit is contained in:
parent
2b581531db
commit
26b57f04b7
|
@ -198,13 +198,13 @@ void LineNumberTextEditor::lineNumberAreaPaintEvent(QPaintEvent *event)
|
|||
else
|
||||
painter.setPen(mLineNumberAreaForeground);
|
||||
int y=top+std::max(0,bottom-top-fontMetrics().lineSpacing());
|
||||
painter.drawText(5, y, lineNumberArea->width()-10, fontMetrics().height(),
|
||||
painter.drawText(5, top, lineNumberArea->width()-10, fontMetrics().height(),
|
||||
Qt::AlignRight, number);
|
||||
}
|
||||
|
||||
block = block.next();
|
||||
top = bottom;
|
||||
bottom = top + qRound(blockBoundingRect(block).height());
|
||||
++blockNumber;
|
||||
qDebug()<<blockNumber<<qRound(blockBoundingRect(block).height());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue