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
|
else
|
||||||
painter.setPen(mLineNumberAreaForeground);
|
painter.setPen(mLineNumberAreaForeground);
|
||||||
int y=top+std::max(0,bottom-top-fontMetrics().lineSpacing());
|
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);
|
Qt::AlignRight, number);
|
||||||
}
|
}
|
||||||
|
|
||||||
block = block.next();
|
block = block.next();
|
||||||
top = bottom;
|
top = bottom;
|
||||||
bottom = top + qRound(blockBoundingRect(block).height());
|
bottom = top + qRound(blockBoundingRect(block).height());
|
||||||
++blockNumber;
|
++blockNumber;
|
||||||
|
qDebug()<<blockNumber<<qRound(blockBoundingRect(block).height());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue