Răsfoiți Sursa

round scrolling when zooming

scott brogden 6 ani în urmă
părinte
comite
a452ec5331
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      ImageViewer.cpp

+ 2 - 2
ImageViewer.cpp

@@ -191,8 +191,8 @@ BOOL CImageViewer::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
 		::ScreenToClient(m_hWnd, &pt);
 		UpdateBitmapSize(false);
 
-		delta.x = (pt.x * (1 / oldScale)) - (pt.x * (1 / m_scale));
-		delta.y = (pt.y * (1 / oldScale)) - (pt.y * (1 / m_scale));
+		delta.x = round((pt.x * (1 / oldScale)) - (pt.x * (1 / m_scale)));
+		delta.y = round((pt.y * (1 / oldScale)) - (pt.y * (1 / m_scale)));
 
 		m_scrollHelper.Update(delta);