flags = (flags & ~Update::FitCursor) | Update::ForceDraw;
}
+ if (lyxrc.draw_strategy == LyXRC::DS_FULL)
+ flags = flags | Update::ForceDraw;
+
// Add flags to the the update flags. These will be reset to None
// after the redraw is actually done
d->update_flags_ = d->update_flags_ | flags;
bool update)
{
if (scrollToCursor(dit, how) && update)
- processUpdateFlags(Update::Force);
+ processUpdateFlags(Update::ForceDraw);
}
d->text_metrics_.clear();
}
+ // This should not be moved earlier
TextMetrics & tm = textMetrics(&buftext);
// make sure inline completion pointer is ok
// Check that the end of the document is not too high
int const min_visible = lyxrc.scroll_below_document ? minVisiblePart() : height_;
- if (tm.last().first == lastpit && tm.last().second->bottom() < min_visible) {
+ if (tm.last().first == lastpit && tm.last().second->hasPosition()
+ && tm.last().second->bottom() < min_visible) {
d->anchor_ypos_ += min_visible - tm.last().second->bottom();
LYXERR(Debug::SCROLLING, "Too high, adjusting anchor ypos to " << d->anchor_ypos_);
tm.updateMetrics(d->anchor_pit_, d->anchor_ypos_, height_);
}
// Check that the start of the document is not too low
- if (tm.first().first == 0 && tm.first().second->top() > 0) {
+ if (tm.first().first == 0 && tm.first().second->hasPosition()
+ && tm.first().second->top() > 0) {
d->anchor_ypos_ -= tm.first().second->top();
LYXERR(Debug::SCROLLING, "Too low, adjusting anchor ypos to " << d->anchor_ypos_);
tm.updateMetrics(d->anchor_pit_, d->anchor_ypos_, height_);
* extra paragraphs are removed
*/
// Remove paragraphs that are outside of screen
- while(tm.first().second->bottom() <= 0) {
+ while(!tm.first().second->hasPosition() || tm.first().second->bottom() <= 0) {
//LYXERR0("Forget pit: " << tm.first().first);
tm.forget(tm.first().first);
}
- while(tm.last().second->top() > height_) {
+ while(!tm.last().second->hasPosition() || tm.last().second->top() > height_) {
//LYXERR0("Forget pit: " << tm.first().first);
tm.forget(tm.last().first);
}