Correct caret position from the start

This commit is contained in:
Jean-Marc Lasgouttes 2020-11-21 19:37:22 +01:00
parent 8dfe07b5b5
commit ba8ca0e384
2 changed files with 4 additions and 3 deletions

View File

@ -3065,6 +3065,8 @@ void BufferView::caretPosAndDim(Point & p, Dimension & dim) const
dim.wid = lyxrc.cursor_width;
p = getPos(cur);
// center fat carets horizontally
p.x_ -= dim.wid / 2;
p.y_ -= dim.asc;
}

View File

@ -138,9 +138,8 @@ public:
{
if (dim.empty())
return;
// correction is (1) for horizontal scrolling and (2) for
// better positionning of large cursors.
int const xx = x - horiz_offset - dim.wid / 2;
// correction for horizontal scrolling
int const xx = x - horiz_offset;
int const lx = dim.height() / 3;
// draw caret box