Mercurial > hg > svgui
diff view/View.cpp @ 1343:5f3e374746b6 zoom
Fix crash when scrolling beyond end of waveform (+ fix compiler warnings)
author | Chris Cannam |
---|---|
date | Thu, 27 Sep 2018 16:20:58 +0100 |
parents | ab2cafd3a7cb |
children | 4949061fcb8c |
line wrap: on
line diff
--- a/view/View.cpp Thu Sep 27 15:54:02 2018 +0100 +++ b/view/View.cpp Thu Sep 27 16:20:58 2018 +0100 @@ -390,12 +390,12 @@ int diff, result; if (m_zoomLevel.zone == ZoomLevel::FramesPerPixel) { - diff = fdiff / level; + diff = int(fdiff / level); if ((fdiff < 0) && ((fdiff % level) != 0)) { --diff; // round to the left } } else { - diff = fdiff * level; + diff = int(fdiff * level); } result = int(diff + (width()/2));