Bug 202332

Summary: View mode: Zooming using Ctrl+Scroll is broken
Product: [Applications] digikam Reporter: Michael Holtermann <linux>
Component: Usability-KeyboardAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: 1.0.0   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In: 1.0.0
Sentry Crash Report:

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