Bug 202332 - View mode: Zooming using Ctrl+Scroll is broken
Summary: View mode: Zooming using Ctrl+Scroll is broken
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Usability-Keyboard (show other bugs)
Version: 1.0.0
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-02 18:22 UTC by Michael Holtermann
Modified: 2017-08-15 05:46 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 1.0.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Holtermann 2009-08-02 18:22:13 UTC
Version:            (using KDE 4.2.4)
OS:                Linux
Installed from:    Debian testing/unstable Packages

Hello,

in view mode, it's possible to zoom the image using Ctrl+Scroll. This works well for horizontal aligned images, but not for vertical aligned images.

In edit mode, it works for both alignments.

Greetings,
Michael.
Comment 1 Marcel Wiesweg 2009-08-04 15:18:01 UTC
SVN commit 1006803 by mwiesweg:

There is a problem using floor(x*10000)/10000 to reduce precision.
For values like 0.50149999999999996 this operation will subtract 1/10000 for every
run (5014 -> 5013 -> 5012...). It's not mathematical correct but floating point
arithmetics on a computer are not mathematically correct sometimes.
If such a value is calculated for fit-to-window as 5014 and truncated to 5013
it will be set by setZoomFactor as 5012.
Now snapZoom() is fooled when the current zoom is 5012 and the desired one is 0.6,
it will snap to 5013 (set as 5012 - and forever again) disabling any zooming.

Using round(x*10000)/10000 instead of floor solves the problem for me.

BUG: 202332

 M  +3 -1      NEWS  
 M  +2 -2      libs/widgets/common/previewwidget.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1006803