1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-07 20:22:13 +01:00

TrackPanelResizerCell, also in 1-to-1 with TrackView, now owned by it

This commit is contained in:
Paul Licameli
2019-06-17 23:23:44 -04:00
parent 18b4c01c51
commit b4c7a8ef2a
6 changed files with 39 additions and 17 deletions

View File

@@ -15,11 +15,13 @@ Paul Licameli split from TrackPanel.cpp
#include "TrackPanelMouseEvent.h"
#include "HitTestResult.h"
#include "tracks/ui/TrackView.h"
#include <wx/mousestate.h>
TrackPanelResizerCell::TrackPanelResizerCell(
const std::shared_ptr<Track> &pTrack )
: CommonTrackCell{ pTrack }
const std::shared_ptr<TrackView> &pView )
: mwView{ pView }
{}
std::vector<UIHandlePtr> TrackPanelResizerCell::HitTest
@@ -27,7 +29,7 @@ std::vector<UIHandlePtr> TrackPanelResizerCell::HitTest
{
(void)pProject;// Compiler food
std::vector<UIHandlePtr> results;
auto pTrack = mpTrack.lock();
auto pTrack = FindTrack();
if (pTrack) {
auto result = std::make_shared<TrackPanelResizeHandle>(
pTrack, st.state.m_y );
@@ -36,3 +38,11 @@ std::vector<UIHandlePtr> TrackPanelResizerCell::HitTest
}
return results;
}
std::shared_ptr<Track> TrackPanelResizerCell::DoFindTrack()
{
const auto pView = mwView.lock();
if ( pView )
return pView->FindTrack();
return {};
}