mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
VTextDocumentLayout: fix hitTest() in cursor block mode
This commit is contained in:
parent
0d6ed84228
commit
00f3665c1c
@ -311,7 +311,7 @@ void VMdEditor::mouseReleaseEvent(QMouseEvent *p_event)
|
||||
return;
|
||||
}
|
||||
|
||||
VTextEdit::mousePressEvent(p_event);
|
||||
VTextEdit::mouseReleaseEvent(p_event);
|
||||
}
|
||||
|
||||
void VMdEditor::mouseMoveEvent(QMouseEvent *p_event)
|
||||
|
@ -353,6 +353,12 @@ int VTextDocumentLayout::hitTest(const QPointF &p_point, Qt::HitTestAccuracy p_a
|
||||
}
|
||||
}
|
||||
|
||||
if (m_cursorBlockMode
|
||||
&& off == block.length() - 1
|
||||
&& off != 0) {
|
||||
--off;
|
||||
}
|
||||
|
||||
return block.position() + off;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user