}
}
- update();
+ if (buffer_)
+ updateMetrics(false);
if (buffer_ && graphics::Previews::status() != LyXRC::PREVIEW_OFF)
graphics::Previews::get().generateBufferPreviews(*buffer_);
if (it.pit() == pit) {
// restored pos may be bigger than it->size
setCursor(makeDocIterator(it, min(pos, it->size())));
- update(Update::FitCursor);
+ // No need to update the metrics if fitCursor returns false.
+ if (fitCursor())
+ updateMetrics(false);
break;
}
}
// The second drawing step is done in WorkArea::redraw() if needed.
// Case when no explicit update is requested.
- if (!(flags & (Update::SinglePar | Update::Force))) {
- if (fitCursor() || multiParSel()) {
- // a CoordCache update is needed
- updateMetrics(false);
- // tell the frontend to update the screen.
- return make_pair(true, false);
- }
+ if (!flags) {
// no need to do anything.
return make_pair(false, false);
}
- // We are now in the case (Update::SinglePar | Update::Force)
- bool single_par = flags & Update::SinglePar;
+ bool full_metrics = flags & Update::Force;
+ if (flags & Update::MultiParSel)
+ full_metrics |= multiParSel();
+
+ bool const single_par = !full_metrics;
updateMetrics(single_par);
- // Don't forget to do check for fitCursor() and multiParSel().
- fitCursor();
- multiParSel();
+ if (flags & Update::FitCursor && fitCursor())
+ updateMetrics(false);
+ // tell the frontend to update the screen.
return make_pair(true, single_par);
}
t.redoParagraph(*this, anchor_ref_);
int const h = t.getPar(anchor_ref_).height();
offset_ref_ = int((bar * t.paragraphs().size() - anchor_ref_) * h);
+ updateMetrics(false);
}