summaryrefslogtreecommitdiff
path: root/src/plugins/texteditor/texteditoroverlay.cpp
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2010-07-14 18:48:36 +0200
committermae <qt-info@nokia.com>2010-07-14 18:48:36 +0200
commitb61c37691497c3fb6c554122475138c302ba44ad (patch)
tree27527074dc4b65ad9dfd450ca3145df340b68150 /src/plugins/texteditor/texteditoroverlay.cpp
parentec223d687e0a518681c88dd0c300896a9b19b56e (diff)
downloadqt-creator-b61c37691497c3fb6c554122475138c302ba44ad.tar.gz
Fix findScope performance issue
Fixes the performance of large find scope selections. Try Ctrl+A Ctrl+F in a large file and scroll.
Diffstat (limited to 'src/plugins/texteditor/texteditoroverlay.cpp')
-rw-r--r--src/plugins/texteditor/texteditoroverlay.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp
index 331e449955..20d38fae38 100644
--- a/src/plugins/texteditor/texteditoroverlay.cpp
+++ b/src/plugins/texteditor/texteditoroverlay.cpp
@@ -138,6 +138,9 @@ QPainterPath TextEditorOverlay::createSelectionPath(const QTextCursor &begin, co
QTextBlock block = begin.block();
+ if (block.blockNumber() < m_editor->firstVisibleBlock().blockNumber() - 4)
+ block = m_editor->document()->findBlockByNumber(m_editor->firstVisibleBlock().blockNumber() - 4);
+
bool inSelection = false;
QVector<QRectF> selection;