D20437: Make selection scrolling go at 60 fps
David Hurka
noreply at phabricator.kde.org
Sun Jun 9 14:32:38 BST 2019
davidhurka added a comment.
Sorry for testing it so late, now that I’m working on PageView.
I don’t like this much, see inline comment. Do you mind if I change it to error accumulation at some time?
INLINE COMMENTS
> pageview.cpp:3760
> +
> + if (pos.x() < horizontalScrollBar()->value()) d->dragScrollVector.setX((pos.x() - horizontalScrollBar()->value())/damping);
> + else if (horizontalScrollBar()->value() + viewport()->width() < pos.x()) d->dragScrollVector.setX((pos.x() - horizontalScrollBar()->value() - viewport()->width())/damping);
This is only integer arithmetic, so `damping = 6` makes the edge scrolling feel a bit coarse. Crossing the edge only 5 pixels does nothing, but dragging only one pixel further gives “full speed”.
I would place `damping` in slotDragScroll(), which can do smoothing by error accumulation. (Bresenham and so on.... ;) )
REPOSITORY
R223 Okular
REVISION DETAIL
https://phabricator.kde.org/D20437
To: kezik, #okular, aacid, sander, ngraham
Cc: davidhurka, sander, ngraham, aacid, ahmedbilal, okular-devel, kezik, joaonetto, tfella, darcyshen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20190609/576bc84e/attachment.html>
More information about the Okular-devel
mailing list