13
0

Remove some more unwanted roundings from control point frame to pixel conversions.

git-svn-id: svn://localhost/ardour2/branches/3.0@12507 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2012-05-31 17:08:25 +00:00
parent 6a388349c6
commit 524b61731a
2 changed files with 5 additions and 4 deletions

View File

@ -246,7 +246,7 @@ AutomationLine::modify_point_y (ControlPoint& cp, double y)
y = min (1.0, y);
y = _height - (y * _height);
double const x = trackview.editor().frame_to_unit (_time_converter->to((*cp.model())->when) - _offset);
double const x = trackview.editor().frame_to_unit_unrounded (_time_converter->to((*cp.model())->when) - _offset);
trackview.editor().session()->begin_reversible_command (_("automation event move"));
trackview.editor().session()->add_command (
@ -607,7 +607,7 @@ AutomationLine::sync_model_with_view_point (ControlPoint& cp, framecnt_t distanc
/* if xval has not changed, set it directly from the model to avoid rounding errors */
if (view_x == trackview.editor().frame_to_unit (_time_converter->to ((*cp.model())->when)) - _offset) {
if (view_x == trackview.editor().frame_to_unit_unrounded (_time_converter->to ((*cp.model())->when)) - _offset) {
view_x = (*cp.model())->when - _offset;
} else {
view_x = trackview.editor().unit_to_frame (view_x);
@ -633,7 +633,7 @@ AutomationLine::control_points_adjacent (double xval, uint32_t & before, uint32_
ControlPoint *acp = 0;
double unit_xval;
unit_xval = trackview.editor().frame_to_unit (xval);
unit_xval = trackview.editor().frame_to_unit_unrounded (xval);
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
@ -817,7 +817,7 @@ AutomationLine::reset_callback (const Evoral::ControlList& events)
* zoom and scroll into account).
*/
tx = trackview.editor().frame_to_unit (tx);
tx = trackview.editor().frame_to_unit_unrounded (tx);
/* convert from canonical view height (0..1.0) to actual
* height coordinates (using X11's top-left rooted system)

View File

@ -202,6 +202,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible {
virtual framepos_t unit_to_frame (double unit) const = 0;
virtual double frame_to_unit (framepos_t frame) const = 0;
virtual double frame_to_unit (double frame) const = 0;
virtual double frame_to_unit_unrounded (framepos_t frame) const = 0;
virtual framepos_t pixel_to_frame (double pixel) const = 0;
virtual gulong frame_to_pixel (framepos_t frame) const = 0;
virtual Selection& get_selection () const = 0;