From: John Levon Date: Mon, 21 Oct 2002 15:29:41 +0000 (+0000) Subject: Fix broken changes of wheel mouse. Sorry ! X-Git-Tag: 1.6.10~18133 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e0660589c44ac5f3b2920be0db260fff58290b53;p=lyx.git Fix broken changes of wheel mouse. Sorry ! git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5460 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index eeb0c4383a..2f4848f6a2 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -393,11 +393,12 @@ void BufferView::Pimpl::scroll(int lines) LyXText const * t = bv_->text; int const line_height = t->defaultHeight(); - int const disp = lines * line_height; + // The new absolute coordinate + int new_first_y = t->first_y + lines * line_height; // Restrict to a valid value - int new_first_y = std::min(t->height - 4 * line_height, disp); - new_first_y = std::max(0, disp); + new_first_y = std::min(t->height - 4 * line_height, new_first_y); + new_first_y = std::max(0, new_first_y); scrollDocView(new_first_y);