}
-void BufferView::checkCursorScrollOffset(PainterInfo & pi)
+void BufferView::checkCursorScrollOffset()
{
CursorSlice rowSlice = d->cursor_.bottom();
TextMetrics const & tm = textMetrics(rowSlice.text());
return;
ParagraphMetrics const & pm = tm.parMetrics(rowSlice.pit());
Row const & row = pm.getRow(rowSlice.pos(),
- d->cursor_.boundary()
- && rowSlice == d->cursor_.top());
+ d->cursor_.boundary() && rowSlice == d->cursor_.top());
rowSlice.pos() = row.pos();
// Set the row on which the cursor lives.
// Horizontal scroll offset of the cursor row in pixels
int offset = d->horiz_scroll_offset_;
- int const MARGIN = Length(2, Length::EM).inPixels(pi.base);
+ int const MARGIN = 2 * theFontMetrics(d->cursor_.real_current_font).em();
+ //lyxerr << "cur_x=" << cur_x << ", offset=" << offset << ", margin=" << MARGIN << endl;
if (cur_x < offset + MARGIN) {
// scroll right
offset = cur_x - MARGIN;
// Check whether the row where the cursor lives needs to be scrolled.
// Update the drawing strategy if needed.
- checkCursorScrollOffset(pi);
+ checkCursorScrollOffset();
switch (d->update_strategy_) {
// Check whether the row where the cursor lives needs to be scrolled.
// Update the drawing strategy if needed.
- void checkCursorScrollOffset(PainterInfo & pi);
+ void checkCursorScrollOffset();
/// The minimal size of the document that is visible. Used
/// when it is allowed to scroll below the document.
case mouse_button::button1:
// Set the cursor
if (!bv->mouseSetCursor(cur, cmd.argument() == "region-select"))
- cur.screenUpdateFlags(Update::SinglePar | Update::FitCursor);
+ cur.screenUpdateFlags(Update::FitCursor);
if (bvcur.wordSelection())
selectWord(bvcur, WHOLE_WORD);
break;
return;
}
if (!bv->mouseSetCursor(cur, false))
- cur.screenUpdateFlags(Update::SinglePar | Update::FitCursor);
+ cur.screenUpdateFlags(Update::FitCursor);
break;
}