diff --git a/NEWS.md b/NEWS.md index 14b05243..4769176c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -26,6 +26,7 @@ Red Panda C++ Version 2.26 - change: In Options -> Language -> Generate Assembly, option "Don't generate SEH directives" default to True. - change: In Options —> Editor -> Code Suggestion, option "Hide symbols starting with underscore" default to True. - fix: Crash if include a non-exist header file in the source. + - fix: Line numbers for problem case input/output/expected texteditors are not vertically centered. Red Panda C++ Version 2.25 diff --git a/RedPandaIDE/widgets/linenumbertexteditor.cpp b/RedPandaIDE/widgets/linenumbertexteditor.cpp index f4e9406b..d91a66ab 100644 --- a/RedPandaIDE/widgets/linenumbertexteditor.cpp +++ b/RedPandaIDE/widgets/linenumbertexteditor.cpp @@ -197,7 +197,8 @@ void LineNumberTextEditor::lineNumberAreaPaintEvent(QPaintEvent *event) painter.setPen(mLineNumberAreaCurrentLine); else painter.setPen(mLineNumberAreaForeground); - painter.drawText(5, top, lineNumberArea->width()-10, fontMetrics().height(), + int y=top+std::max(0,bottom-top-fontMetrics().lineSpacing()); + painter.drawText(5, y, lineNumberArea->width()-10, fontMetrics().height(), Qt::AlignRight, number); }