13
0

add Drag::pixel_to_time() which reflects the Drag's _time_domain setting

This commit is contained in:
Paul Davis 2021-12-04 19:38:26 -07:00
parent fc155e76b4
commit 845b5d81a9
2 changed files with 13 additions and 0 deletions

View File

@ -279,6 +279,17 @@ Drag::Drag (Editor* e, ArdourCanvas::Item* i, Temporal::TimeDomain td, bool trac
{
}
timepos_t
Drag::pixel_to_time (double x) const
{
samplepos_t p = _editor->pixel_to_sample (x);
if (_time_domain == Temporal::AudioTime) {
return timepos_t (p);
}
return timepos_t (timepos_t (p).beats ());
}
void
Drag::swap_grab (ArdourCanvas::Item* new_item, Gdk::Cursor* cursor, uint32_t /*time*/)

View File

@ -252,6 +252,8 @@ protected:
return _grab_y;
}
Temporal::timepos_t pixel_to_time (double x) const;
Temporal::timepos_t raw_grab_time () const {
return _raw_grab_time;
}