| 272 | } |
| 273 | |
| 274 | void EnvelopeEditor::MoveDragPoint(const wxMouseEvent & event, wxRect & r, |
| 275 | const ZoomInfo &zoomInfo, bool dB, double dBRange, |
| 276 | float zoomMin, float zoomMax) |
| 277 | { |
| 278 | int clip_y = event.m_y - r.y; |
| 279 | if(clip_y < 0) clip_y = 0; |
| 280 | if(clip_y > r.height) clip_y = r.height; |
| 281 | double newVal = ValueOfPixel(clip_y, r.height, mUpper, dB, dBRange, |
| 282 | zoomMin, zoomMax); |
| 283 | |
| 284 | // We no longer tolerate multiple envelope points at the same t. |
| 285 | // epsilon is less than the time offset of a single sample |
| 286 | // TODO: However because mTrackEpsilon assumes 200KHz this use |
| 287 | // of epsilon is a tad bogus. What we need to do instead is DELETE |
| 288 | // a duplicated point on a mouse up. |
| 289 | double newWhen = zoomInfo.PositionToTime(event.m_x, r.x) - mEnvelope.GetOffset(); |
| 290 | mEnvelope.MoveDragPoint(newWhen, newVal); |
| 291 | } |
| 292 | |
| 293 | bool EnvelopeEditor::HandleDragging(const wxMouseEvent & event, wxRect & r, |
| 294 | const ZoomInfo &zoomInfo, bool dB, double dBRange, |
nothing calls this directly
no test coverage detected