diff --git a/src/Envelope.cpp b/src/Envelope.cpp index 18f84d190..e2eec3ffd 100644 --- a/src/Envelope.cpp +++ b/src/Envelope.cpp @@ -1026,14 +1026,6 @@ double Envelope::GetValue(double t) const return temp; } -// 'X' is in pixels and relative to track. -double Envelope::GetValueAtX(int x, const wxRect & r, double h, double pps) -{ - // Convert x to time. - double t = (x - r.x) / pps + h ;//-mOffset; - return GetValue(t); -} - /// @param Lo returns last index at or before this time. /// @param Hi returns first index after this time. void Envelope::BinarySearchForTime( int &Lo, int &Hi, double t ) const diff --git a/src/Envelope.h b/src/Envelope.h index 47c42375e..508c5c76d 100644 --- a/src/Envelope.h +++ b/src/Envelope.h @@ -151,8 +151,6 @@ class Envelope : public XMLTagHandler { // Accessors /** \brief Get envelope value at time t */ double GetValue(double t) const; - /** \brief Get envelope value at pixel X */ - double GetValueAtX(int x, const wxRect & r, double h, double pps); /** \brief Get many envelope points at once. * diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 5ad6180d8..54dbad149 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -7008,8 +7008,8 @@ bool TrackPanel::HitTestEnvelope(Track *track, wxRect &r, wxMouseEvent & event) return false; // No envelope, not a hit, so return. // Get envelope point, range 0.0 to 1.0 - double envValue = envelope->GetValueAtX( - event.m_x, r, mViewInfo->h, mViewInfo->zoom ); + // Convert x to time. + const double envValue = envelope->GetValue(mViewInfo->PositionToTime(event.m_x, r.x)); float zoomMin, zoomMax; wavetrack->GetDisplayBounds(&zoomMin, &zoomMax);