MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / GetChannelAtPoint

Method GetChannelAtPoint

Source/PatternEditor.cpp:1755–1770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1753// // //
1754
1755int CPatternEditor::GetChannelAtPoint(int PointX) const
1756{
1757 // Convert X position to channel number
1758 const int ChannelCount = GetChannelCount();
1759
1760 if (PointX < m_iRowColumnWidth)
1761 return -1; // -1 means row number column
1762
1763 const int Offset = PointX - m_iRowColumnWidth + m_iChannelOffsets[m_iFirstChannel];
1764 for (int i = m_iFirstChannel; i < ChannelCount; ++i) {
1765 if (Offset >= m_iChannelOffsets[i] && Offset < (m_iChannelOffsets[i] + m_iChannelWidths[i]))
1766 return i;
1767 }
1768
1769 return m_iFirstChannel + m_iChannelsVisible;
1770}
1771
1772cursor_column_t CPatternEditor::GetColumnAtPoint(int PointX) const // // //
1773{

Callers 1

OnRButtonUpMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected