| 421 | } |
| 422 | |
| 423 | SelectHandle::SelectHandle( |
| 424 | const std::shared_ptr<ChannelView> &pChannelView, bool useSnap, |
| 425 | const TrackList &trackList, |
| 426 | const TrackPanelMouseState &st, const ViewInfo &viewInfo |
| 427 | ) : mpView{ pChannelView } |
| 428 | // Selection dragging can snap to play region boundaries |
| 429 | , mSnapManager{ std::make_shared<SnapManager>( |
| 430 | *trackList.GetOwner(), trackList, viewInfo, SnapPointArray{ |
| 431 | SnapPoint{ viewInfo.playRegion.GetLastActiveStart() }, |
| 432 | SnapPoint{ viewInfo.playRegion.GetLastActiveEnd() }, |
| 433 | } ) } |
| 434 | { |
| 435 | const wxMouseState &state = st.state; |
| 436 | mRect = st.rect; |
| 437 | |
| 438 | auto time = std::max(0.0, viewInfo.PositionToTime(state.m_x, mRect.x)); |
| 439 | auto pTrack = FindTrack(pChannelView->FindChannel().get()); |
| 440 | mSnapStart = mSnapManager->Snap(pTrack, time, false); |
| 441 | if (mSnapStart.snappedPoint) |
| 442 | mSnapStart.outCoord += mRect.x; |
| 443 | else |
| 444 | mSnapStart.outCoord = -1; |
| 445 | |
| 446 | mUseSnap = useSnap; |
| 447 | } |
| 448 | |
| 449 | SelectHandle::~SelectHandle() |
| 450 | { |
nothing calls this directly
no test coverage detected