X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FTextMetrics.cpp;h=e5345dd0405c7cd775dfc0dbd5de582aa846c713;hb=12ca81f2ea44c947fcd5f6d4f4c57bd5ebdf98d9;hp=42637d78993d3065e35a48a1c88df98a908aff28;hpb=fa4fc6fc4d97f5c3d3e8ba44ad8b52f750293623;p=lyx.git diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 42637d7899..e5345dd040 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -1502,14 +1502,14 @@ int TextMetrics::cursorX(CursorSlice const & sl, int TextMetrics::cursorY(CursorSlice const & sl, bool boundary) const { //lyxerr << "TextMetrics::cursorY: boundary: " << boundary << endl; - ParagraphMetrics const & pm = par_metrics_[sl.pit()]; + ParagraphMetrics const & pm = parMetrics(sl.pit()); if (pm.rows().empty()) return 0; int h = 0; - h -= par_metrics_[0].rows()[0].ascent(); + h -= parMetrics(0).rows()[0].ascent(); for (pit_type pit = 0; pit < sl.pit(); ++pit) { - h += par_metrics_[pit].height(); + h += parMetrics(pit).height(); } int pos = sl.pos(); if (pos && boundary) @@ -1884,15 +1884,14 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type const pit, int const // whether this row is the first or last and update the margins. if (row.selection()) { if (row.sel_beg == 0) - row.begin_margin_sel = sel_beg.pit() < pit; + row.change(row.begin_margin_sel, sel_beg.pit() < pit); if (row.sel_end == sel_end_par.lastpos()) - row.end_margin_sel = sel_end.pit() > pit; + row.change(row.end_margin_sel, sel_end.pit() > pit); } // has row changed since last paint? bool row_has_changed = row.changed() - || bv_->hadHorizScrollOffset(text_, pit, row.pos()) - || bv_->needRepaint(text_, row); + || bv_->hadHorizScrollOffset(text_, pit, row.pos()); // Take this opportunity to spellcheck the row contents. if (row_has_changed && pi.do_spellcheck && lyxrc.spellcheck_continuously) {