sane.ds: Fix a subtle bug that prevented the float scrollbar from incrementing by one.

This commit is contained in:
Jeremy White 2009-03-05 17:13:45 -06:00 committed by Alexandre Julliard
parent 1bdac9cf9d
commit 956c296a32
1 changed files with 6 additions and 2 deletions

View File

@ -853,10 +853,14 @@ static INT_PTR InitializeDialog(HWND hwnd)
dd = SANE_UNFIX(*sf);
HeapFree(GetProcessHeap(),0,sf);
/* Note that conversion of float -> SANE_Fixed is lossy;
* and when you truncate it into an integer, you can get
* unfortunate results. This calculation attempts
* to mitigate that harm */
if (s_quant)
pos = (dd / s_quant);
pos = ((dd + (s_quant/2.0)) / s_quant);
else
pos = dd / 0.01;
pos = (dd + 0.005) / 0.01;
SendMessageW(control, SBM_SETPOS, pos, TRUE);