# HG changeset patch # User Chris Cannam # Date 1432215688 -3600 # Node ID faa8532e4f02e4881f8816f563669ca8e14ffc87 # Parent e297b7d752f20ad91bf14efd99f4e7faba07ab15 Fix arithmetic precedence misreading goof which led to scrolling the wrong way when dragging past the right edge diff -r e297b7d752f2 -r faa8532e4f02 view/Pane.cpp --- a/view/Pane.cpp Thu May 21 14:06:20 2015 +0100 +++ b/view/Pane.cpp Thu May 21 14:41:28 2015 +0100 @@ -2152,11 +2152,12 @@ sv_frame_t offset = mouseFrame - getStartFrame(); sv_frame_t available = getEndFrame() - getStartFrame(); sv_frame_t move = 0; - if (offset >= double(available) * 0.95) { - move = sv_frame_t(double(offset - available) * 0.95) + 1; - } else if (offset <= double(available) * 0.10) { - move = sv_frame_t(double(available) * 0.10 - double(offset)) + 1; - move = -move; + sv_frame_t rightEdge = available - (available / 20); + sv_frame_t leftEdge = (available / 10); + if (offset >= rightEdge) { + move = offset - rightEdge + 1; + } else if (offset <= leftEdge) { + move = offset - leftEdge - 1; } if (move != 0) { setCentreFrame(m_centreFrame + move);