From 2873cb878574de7caa18cd27299d8a050394283a Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sun, 24 Mar 2024 12:21:49 +0800 Subject: [PATCH] ensure top pos aligns with line height after drop --- libs/qsynedit/qsynedit/qsynedit.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/qsynedit/qsynedit/qsynedit.cpp b/libs/qsynedit/qsynedit/qsynedit.cpp index bfb3def7..a1a48be2 100644 --- a/libs/qsynedit/qsynedit/qsynedit.cpp +++ b/libs/qsynedit/qsynedit/qsynedit.cpp @@ -6378,6 +6378,11 @@ void QSynEdit::dropEvent(QDropEvent *event) endEditing(); event->acceptProposedAction(); mDropped = true; + if (topPos!=mMouseScrollOldTop) { + int offset = topPos % mTextHeight; + if (offset!=0) + topPos -= offset; + } setTopPos(topPos); setLeftPos(leftPos); internalSetCaretXY(coord);