Audacity 3.2.0
Functions
anonymous_namespace{CutlineHandle.cpp} Namespace Reference

Functions

bool IsOverCutline (const WaveTrackLocations &locations, const ViewInfo &viewInfo, const wxRect &rect, const wxMouseState &state, WaveTrackLocation *pmLocation)
 

Function Documentation

◆ IsOverCutline()

bool anonymous_namespace{CutlineHandle.cpp}::IsOverCutline ( const WaveTrackLocations locations,
const ViewInfo viewInfo,
const wxRect &  rect,
const wxMouseState &  state,
WaveTrackLocation pmLocation 
)

Definition at line 56 of file CutlineHandle.cpp.

60 {
61 for (auto loc: locations) {
62 const double x = viewInfo.TimeToPosition(loc.pos);
63 if (x >= 0 && x < rect.width)
64 {
65 wxRect locRect;
66 locRect.width = 2 * kPixelTolerance - 1;
67 locRect.x = (int)(rect.x + x) - locRect.width / 2;
68 locRect.y = rect.y;
69 locRect.height = rect.height;
70 if (locRect.Contains(state.m_x, state.m_y))
71 {
72 if (pmLocation)
73 *pmLocation = loc;
74 return true;
75 }
76 }
77 }
78
79 return false;
80 }
const int kPixelTolerance
Definition: Snap.h:28
int64 TimeToPosition(double time, int64 origin=0, bool ignoreFisheye=false) const
STM: Converts a project time to screen x position.
Definition: ZoomInfo.cpp:44

References kPixelTolerance, and ZoomInfo::TimeToPosition().

Referenced by CutlineHandle::HitTest().

Here is the call graph for this function:
Here is the caller graph for this function: