From f4859ee094da697999b158c194e89581b8e4c97b Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Tue, 15 Jan 2019 00:00:12 +0100 Subject: [PATCH] ui: Improved line number disappearing fix --- src/lib_gui/qt/element/QtCodeArea.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/lib_gui/qt/element/QtCodeArea.cpp b/src/lib_gui/qt/element/QtCodeArea.cpp index 2f8be508..24d6e8ab 100644 --- a/src/lib_gui/qt/element/QtCodeArea.cpp +++ b/src/lib_gui/qt/element/QtCodeArea.cpp @@ -231,17 +231,13 @@ void QtCodeArea::lineNumberAreaPaintEvent(QPaintEvent *event) QPen p = painter.pen(); - int scrollBarHeight = 0; - if (horizontalScrollBar()->minimum() != horizontalScrollBar()->maximum() && utility::getOsType() != OS_MAC) - { - scrollBarHeight = horizontalScrollBar()->height(); - } - - const int drawAreaTop = event->rect().top(); + int drawAreaTop = event->rect().top(); int drawAreaBottom = event->rect().bottom() + 1; - if (drawAreaBottom > height() - scrollBarHeight) + + if (horizontalScrollBar()->minimum() != horizontalScrollBar()->maximum() && utility::getOsType() != OS_MAC && + drawAreaBottom > height() - horizontalScrollBar()->height()) { - drawAreaBottom = height() - scrollBarHeight; + drawAreaBottom = height() - horizontalScrollBar()->height(); } while (block.isValid() && top <= drawAreaBottom)