[Digikam-devel] [Bug 202332] View mode: Zooming using Ctrl+Scroll is broken

Marcel Wiesweg marcel.wiesweg at gmx.de
Tue Aug 4 14:18:08 BST 2009


https://bugs.kde.org/show_bug.cgi?id=202332


Marcel Wiesweg <marcel.wiesweg at gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED




--- Comment #1 from Marcel Wiesweg <marcel wiesweg gmx de>  2009-08-04 15:18:01 ---
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

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list