drag&drop tweak

This commit is contained in:
Roy Qu 2024-03-24 12:23:58 +08:00
parent 2873cb8785
commit 3c9ac38913
1 changed files with 8 additions and 0 deletions

View File

@ -6302,6 +6302,14 @@ void QSynEdit::dropEvent(QDropEvent *event)
&& coord>=mDragSelBeginSave && coord<=mDragSelEndSave) && coord>=mDragSelBeginSave && coord<=mDragSelEndSave)
) { ) {
mDocument->deleteAt(mDocument->count()-1); mDocument->deleteAt(mDocument->count()-1);
int topPos = mTopPos;
if (topPos!=mMouseScrollOldTop) {
int offset = topPos % mTextHeight;
if (offset!=0)
topPos -= offset;
setTopPos(topPos);
ensureCaretVisible();
}
//do nothing if drag onto itself //do nothing if drag onto itself
event->acceptProposedAction(); event->acceptProposedAction();
mDropped = true; mDropped = true;