diff options
author | Carl Hetherington <carl@carlh.net> | 2012-05-31 17:07:02 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-05-31 17:07:02 +0000 |
commit | 650f16620d270523aee04b15419dc9d667042928 (patch) | |
tree | f20b652687b62883fdcb1c4daa28cc36eb25c3a9 /gtk2_ardour | |
parent | fc77252d5186360c6a00f0f098f43253cd26e4ba (diff) |
Don't round conversions from frame to unit when setting up control points, as it will cause big inaccuracies when zoomed out.
git-svn-id: svn://localhost/ardour2/branches/3.0@12503 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index e51fe88d45..0dd162ca20 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -239,6 +239,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD return rint ((double) frame / (double) frames_per_unit); } + double frame_to_unit_unrounded (framepos_t frame) const { + return frame / frames_per_unit; + } + double frame_to_unit (double frame) const { return rint (frame / frames_per_unit); } diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index e3b7d06d35..c84b5520b7 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -2875,7 +2875,7 @@ ControlPointDrag::motion (GdkEvent* event, bool) bool const push = Keyboard::modifier_state_contains (event->button.state, Keyboard::PrimaryModifier); - _point->line().drag_motion (_editor->frame_to_unit (cx_frames), fraction, false, push); + _point->line().drag_motion (_editor->frame_to_unit_unrounded (cx_frames), fraction, false, push); _editor->verbose_cursor()->set_text (_point->line().get_verbose_cursor_string (fraction)); } |