mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Defer construction of temporary cursor.
We were doing this on every mouse movement. I.e., for every single
pixel the mouse traverses. It can be expensive if there are a lot
of math insets.
(cherry picked from commit 4e8aa89eb9
)
This commit is contained in:
parent
d29baf59a4
commit
365ff71e23
@ -2678,11 +2678,6 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
|
||||
// LFUN_FILE_OPEN generated by drag-and-drop.
|
||||
FuncRequest cmd = cmd0;
|
||||
|
||||
Cursor old = cursor();
|
||||
Cursor cur(*this);
|
||||
cur.push(buffer_.inset());
|
||||
cur.selection(d->cursor_.selection());
|
||||
|
||||
// Either the inset under the cursor or the
|
||||
// surrounding Text will handle this event.
|
||||
|
||||
@ -2700,6 +2695,11 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
|
||||
return;
|
||||
}
|
||||
|
||||
Cursor old = cursor();
|
||||
Cursor cur(*this);
|
||||
cur.push(buffer_.inset());
|
||||
cur.selection(d->cursor_.selection());
|
||||
|
||||
// Build temporary cursor.
|
||||
Inset * inset = d->text_metrics_[&buffer_.text()].editXY(cur, cmd.x(), cmd.y());
|
||||
if (inset) {
|
||||
|
Loading…
Reference in New Issue
Block a user