From 95859d960521f071c37c48ce7099e308bd9fcf04 Mon Sep 17 00:00:00 2001 From: malte_langkabel Date: Mon, 10 Oct 2016 11:37:56 +0200 Subject: [PATCH] ui: fixed panning to avoid jumping back to zero on mouse down --- src/lib_gui/qt/element/QtCodeArea.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib_gui/qt/element/QtCodeArea.cpp b/src/lib_gui/qt/element/QtCodeArea.cpp index c1b51d47..293feaf3 100644 --- a/src/lib_gui/qt/element/QtCodeArea.cpp +++ b/src/lib_gui/qt/element/QtCodeArea.cpp @@ -537,7 +537,13 @@ void QtCodeArea::clearSelection() { QTextCursor cursor = textCursor(); cursor.clearSelection(); + + QScrollBar* scrollbar = horizontalScrollBar(); + int scrollValue = horizontalScrollBar()->value(); + setTextCursor(cursor); + + scrollbar->setValue(scrollValue); } void QtCodeArea::setIDECursorPosition()