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:
@@ -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 {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user