- fix: Line numbers for problem case input/output/expected texteditors are not vertically centered.

This commit is contained in:
Roy Qu 2023-11-06 20:58:18 +08:00
parent aa12dcc4d1
commit 4a8b3e1896
2 changed files with 3 additions and 1 deletions

View File

@ -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 -> 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. - 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: 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 Red Panda C++ Version 2.25

View File

@ -197,7 +197,8 @@ void LineNumberTextEditor::lineNumberAreaPaintEvent(QPaintEvent *event)
painter.setPen(mLineNumberAreaCurrentLine); painter.setPen(mLineNumberAreaCurrentLine);
else else
painter.setPen(mLineNumberAreaForeground); 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); Qt::AlignRight, number);
} }