Skip to content

Conversation

@vedgy
Copy link
Contributor

@vedgy vedgy commented Feb 10, 2021

See the commit messages for details.

{
// TODO: consider handling horizontal scrolling differently.
const auto delta = event->angleDelta().x() + event->angleDelta().y();
const bool grow = delta < 0;
Copy link
Contributor Author

@vedgy vedgy Feb 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The zoom in/out direction of the Magnifying glass is opposite to the direction in other applications. Is this intentional or an oversight that should be fixed by initializing grow with delta > 0? If this is intentional, the reason should be explained in a comment.

@vedgy vedgy mentioned this pull request Mar 7, 2021
vedgy added 7 commits March 21, 2021 10:00
Add a local elapsedMs variable to improve readability and performance.

Remove some of the redundant parentheses in a long `if` statement to
improve readability.
QTime's start(), restart() and elapsed() member functions have been
deprecated since Qt 5.14 and were removed in Qt 6.

Don't leak the timer object in ScrollManagement.

Add a local elapsedMs variable to improve readability and performance.

Remove some of the redundant parentheses to improve readability.
GoToFlow and ComicFlow are the only two classes that use YACReaderFlow.
They both handled wheelEvent() manually in practically the same way as
YACReaderFlow does now, except for time and minimum move checks in
ScrollManagement::getMovement().

This new implementation is equivalent to and consistent with the OpenGL
version in YACReaderFlowGL::wheelEvent().
QWheelEvent::orientation() and QWheelEvent::delta() are deprecated. The
documentation for both suggests using QWheelEvent::angleDelta() instead.

Keep treating the horizontal mouse wheel the same as vertical in Comic
and Page Flow: comics and pages move horizontally, so horizontal
scrolling is even more natural than vertical in these cases.

Viewer handles horizontal scrolling separately - to scroll the comic
page to the right or to the left. So ScrollManagement must ignore
horizontal delta in this case. For this purpose the new parameter in
ScrollManagement::getMovement() determines which orientations are taken
into account: horizontal, vertical or both.

Remove redundant parentheses in long `if` statements to improve
readability.
Keep treating horizontal and vertical scrolling equivalently.
@vedgy vedgy force-pushed the fix-some-qt-deprecation-warnings branch from fc01882 to c8f0be9 Compare March 21, 2021 08:01
@luisangelsm luisangelsm force-pushed the develop branch 6 times, most recently from 728e9bb to 2cd511f Compare October 7, 2025 10:30
@luisangelsm luisangelsm force-pushed the develop branch 10 times, most recently from 5d712af to c2aa5f6 Compare October 16, 2025 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant