From 26b57f04b7198af467942510cd6a80c80d0e0063 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 19 Jan 2024 16:23:41 +0800 Subject: [PATCH] fix: Line numbers for problem case input/output/expected texteditors are not vertically centered. --- RedPandaIDE/widgets/linenumbertexteditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RedPandaIDE/widgets/linenumbertexteditor.cpp b/RedPandaIDE/widgets/linenumbertexteditor.cpp index d91a66ab..ffa78afb 100644 --- a/RedPandaIDE/widgets/linenumbertexteditor.cpp +++ b/RedPandaIDE/widgets/linenumbertexteditor.cpp @@ -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()<