diff --git a/src/render/katerenderer.cpp b/src/render/katerenderer.cpp --- a/src/render/katerenderer.cpp +++ b/src/render/katerenderer.cpp @@ -946,10 +946,9 @@ void KateRenderer::updateFontHeight() { - // use height of font + round down, ensure we have at least one pixel - // we round down to avoid artifacts: line height too large vs. qt background rendering of text attributes - const qreal height = config()->fontMetrics().height(); - m_fontHeight = qMax(1, qFloor(height)); + // ensure minimal height of one pixel to not fall in the div by 0 trap somewhere + // use font line spacing, this includes the leading + m_fontHeight = qMax(1, qCeil(config()->fontMetrics().lineSpacing())); } void KateRenderer::updateMarkerSize() @@ -1031,6 +1030,9 @@ line.setLineWidth(maxwidth); } + // we include the leading, this must match the ::updateFontHeight code! + line.setLeadingIncluded(true); + line.setPosition(QPoint(line.lineNumber() ? shiftX : 0, height)); if (needShiftX && line.width() > 0)