]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.cpp
UserGuide.lyx: update 2 images
[lyx.git] / src / BufferView.cpp
index 1daee5c720faff049b907e5d452da7106e804aa1..2739e00ba31cb4b1f0ec4f374c1a888f6980e3ce 100644 (file)
@@ -2914,15 +2914,26 @@ int BufferView::horizScrollOffset() const
 }
 
 
-CursorSlice const & BufferView::currentRowSlice() const
-{
-       return d->current_row_slice_;
+int BufferView::horizScrollOffset(Text const * text,
+                                  pit_type pit, pos_type pos) const
+{
+       // Is this a row that is currently scrolled?
+       if (!d->current_row_slice_.empty()
+           && &text->inset() == d->current_row_slice_.inset().asInsetText()
+           && pit ==  d->current_row_slice_.pit()
+           && pos ==  d->current_row_slice_.pos())
+               return d->horiz_scroll_offset_;
+       return 0;
 }
 
 
-CursorSlice const & BufferView::lastRowSlice() const
+bool BufferView::hadHorizScrollOffset(Text const * text,
+                                      pit_type pit, pos_type pos) const
 {
-       return d->last_row_slice_;
+       return !d->last_row_slice_.empty()
+              && &text->inset() == d->last_row_slice_.inset().asInsetText()
+              && pit ==  d->last_row_slice_.pit()
+              && pos ==  d->last_row_slice_.pos();
 }
 
 
@@ -2988,8 +2999,7 @@ void BufferView::checkCursorScrollOffset(PainterInfo & pi)
                bool const drawing = pi.pain.isDrawingEnabled();
                pi.pain.setDrawingEnabled(false);
                // No need to care about vertical position.
-               RowPainter rp(pi, buffer().text(), d->cursor_.bottom().pit(), row,
-                             -d->horiz_scroll_offset_, 0);
+               RowPainter rp(pi, buffer().text(), row, -d->horiz_scroll_offset_, 0);
                rp.paintText();
                pi.pain.setDrawingEnabled(drawing);
        }