@@ -138,16 +138,16 @@ int MarkersModel::keySearch(int key, int currentPosition = 0, bool reverse = fal
138138}
139139
140140// Custom Recursive Binary Search: Returns most proximate element in a given direction when searched element is not found.
141- Marker MarkersModel::binarySearch (const int l, const int r, const int goalPosition, const bool reverse = false )
141+ Marker MarkersModel::binarySearch (const double l, const double r, const double goalPosition, const bool reverse = false )
142142{
143143 // qDebug() << "search in progress";
144144 if (r >= l) {
145145 // qDebug() << "l: " << l << ", r: " << r << ", gp: " << goalPosition;
146146
147147 // Binary search
148- const int mid = l + (r - l) / 2 ;
148+ const double mid = l + (r - l) / 2 ;
149149
150- const int aimValue = m_data.at (mid).position ;
150+ const double aimValue = m_data.at (mid).position ;
151151 // Base case
152152 if (aimValue == goalPosition) {
153153 // If last element
@@ -192,7 +192,7 @@ Marker MarkersModel::binarySearch(const int l, const int r, const int goalPositi
192192 return m_data.at (l);
193193}
194194
195- Marker MarkersModel::nextMarker (int position)
195+ Marker MarkersModel::nextMarker (double position)
196196{
197197 // qDebug() << Qt::endl;
198198 const int size = rowCount ();
@@ -204,7 +204,7 @@ Marker MarkersModel::nextMarker(int position)
204204 return invalidPositionMarker; // -1
205205}
206206
207- Marker MarkersModel::previousMarker (int position)
207+ Marker MarkersModel::previousMarker (double position)
208208{
209209 // qDebug() << Qt::endl;
210210 const int size = rowCount ();
0 commit comments