ensure top pos aligns with line height after drop

This commit is contained in:
Roy Qu 2024-03-24 12:21:49 +08:00
parent 9fc276325e
commit 2873cb8785
1 changed files with 5 additions and 0 deletions

View File

@ -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);