}
-void BufferView::scrollDocView(int const pixels, bool update)
+void BufferView::scrollDocView(int const pixels)
{
// The scrollbar values are relative to the top of the screen, therefore the
// offset is equal to the target value.
// cut off at the top
if (pixels <= d->scrollbarParameters_.min) {
DocIterator dit = doc_iterator_begin(&buffer_);
- showCursor(dit, SCROLL_VISIBLE, update);
+ showCursor(dit, SCROLL_VISIBLE);
LYXERR(Debug::SCROLLING, "scroll to top");
return;
}
if (pixels >= d->scrollbarParameters_.max) {
DocIterator dit = doc_iterator_end(&buffer_);
dit.backwardPos();
- showCursor(dit, SCROLL_VISIBLE, update);
+ showCursor(dit, SCROLL_VISIBLE);
LYXERR(Debug::SCROLLING, "scroll to bottom");
return;
}
// It seems we didn't find the correct pit so stay on the safe side and
// scroll to bottom.
LYXERR0("scrolling position not found!");
- scrollDocView(d->scrollbarParameters_.max, update);
+ scrollDocView(d->scrollbarParameters_.max);
return;
}
DocIterator dit = doc_iterator_begin(&buffer_);
dit.pit() = i;
LYXERR(Debug::SCROLLING, "pixels = " << pixels << " -> scroll to pit " << i);
- showCursor(dit, SCROLL_VISIBLE, update);
+ showCursor(dit, SCROLL_VISIBLE);
}
void BufferView::recenter()
{
- showCursor(d->cursor_, SCROLL_CENTER, true);
+ showCursor(d->cursor_, SCROLL_CENTER);
}
void BufferView::showCursor()
{
- showCursor(d->cursor_, SCROLL_VISIBLE, true);
+ showCursor(d->cursor_, SCROLL_VISIBLE);
}
-void BufferView::showCursor(DocIterator const & dit, ScrollType how,
- bool update)
+void BufferView::showCursor(DocIterator const & dit, ScrollType how)
{
- if (scrollToCursor(dit, how) && update)
- processUpdateFlags(Update::Force);
+ if (scrollToCursor(dit, how))
+ processUpdateFlags(Update::ForceDraw);
}
/// This method will automatically scroll and update the BufferView
/// (metrics+drawing) if needed.
/// \param how Use this scroll strategy
- /// \param force If true, update screen after scrolling
- void showCursor(DocIterator const & dit, ScrollType how, bool update);
+ void showCursor(DocIterator const & dit, ScrollType how);
/// Scroll to the cursor.
/// \param how Use this scroll strategy
/// \return true if screen was scrolled
/// scroll document by the given number of pixels.
int scroll(int pixels);
/// Scroll the view by a number of pixels.
- void scrollDocView(int pixels, bool update);
+ void scrollDocView(int pixels);
/// Set the cursor position based on the scrollbar one.
void setCursorFromScrollbar();
void GuiWorkArea::scrollTo(int value)
{
stopBlinkingCaret();
- d->buffer_view_->scrollDocView(value, true);
+ d->buffer_view_->scrollDocView(value);
if (lyxrc.cursor_follows_scrollbar) {
d->buffer_view_->setCursorFromScrollbar();
// Scroll
if (step <= 2 * wh) {
d->buffer_view_->scroll(up ? -step : step);
- d->buffer_view_->updateMetrics();
+ d->buffer_view_->processUpdateFlags(Update::ForceDraw);
} else {
- d->buffer_view_->scrollDocView(value + (up ? -step : step), false);
+ d->buffer_view_->scrollDocView(value + (up ? -step : step));
}
// In which paragraph do we have to set the cursor ?