diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index fcc57f11380e90097f11244d72a1566a9d6afa5e..26abcf002dc80733cffd591c6ec3b7c5ad9b68c4 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -2440,7 +2440,7 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
 
                 int boxWidth = collapseBoxWidth(fm);
                 if (hovered) {
-                    QRect box = QRect(extraAreaWidth + 1, top, boxWidth - 2, fmLineSpacing + 2);
+                    QRect box = QRect(extraAreaWidth + 1, top, boxWidth - 2, bottom - top);
                     drawRectBox(&painter, box, drawStart, drawEnd, pal);
                 }