summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-11-15 19:41:00 +0100
committerRobin Gareus <robin@gareus.org>2014-11-15 19:41:15 +0100
commit4a17f9e941271871173e8b25b519ff5fd9068fb8 (patch)
treea8c911759fe05809203067ed2d8b5aadaaa63fcd /gtk2_ardour
parent0680d0b0ee103ec003ff1dfefe76534471f85ba1 (diff)
round control-scroll offsets towards zero
fixes MCU "Locate called for negative sample position"
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index a0dcf72db2..c47e997182 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -1065,12 +1065,12 @@ Editor::control_scroll (float fraction)
_dragging_playhead = true;
}
- if ((fraction < 0.0f) && (*_control_scroll_target < (framepos_t) fabs(step))) {
+ if ((fraction < 0.0f) && (*_control_scroll_target <= (framepos_t) fabs(step))) {
*_control_scroll_target = 0;
} else if ((fraction > 0.0f) && (max_framepos - *_control_scroll_target < step)) {
*_control_scroll_target = max_framepos - (current_page_samples()*2); // allow room for slop in where the PH is on the screen
} else {
- *_control_scroll_target += (framepos_t) floor (step);
+ *_control_scroll_target += (framepos_t) trunc (step);
}
/* move visuals, we'll catch up with it later */