Shift dragging time selection edge moves whole time selection. Should do this more properly...

This commit is contained in:
xenakios 2018-02-22 05:23:39 +02:00
parent c98b7c70e4
commit 3d53c4fb91

View File

@ -614,13 +614,27 @@ void WaveformComponent::mouseDrag(const MouseEvent & e)
m_time_sel_start = m_drag_time_start; m_time_sel_start = m_drag_time_start;
m_time_sel_end = jmap<double>(e.x, 0, getWidth(), m_view_range.getStart(), m_view_range.getEnd()); m_time_sel_end = jmap<double>(e.x, 0, getWidth(), m_view_range.getStart(), m_view_range.getEnd());
} }
double curlen = m_time_sel_end-m_time_sel_start;
if (m_time_sel_drag_target == 1) if (m_time_sel_drag_target == 1)
{ {
if (e.mods.isShiftDown()==false)
m_time_sel_start = jmap<double>(e.x, 0, getWidth(), m_view_range.getStart(), m_view_range.getEnd()); m_time_sel_start = jmap<double>(e.x, 0, getWidth(), m_view_range.getStart(), m_view_range.getEnd());
else
{
m_time_sel_start = jmap<double>(e.x, 0, getWidth(), m_view_range.getStart(), m_view_range.getEnd());
m_time_sel_end = m_time_sel_start+curlen;
}
} }
if (m_time_sel_drag_target == 2) if (m_time_sel_drag_target == 2)
{ {
if (e.mods.isShiftDown()==false)
m_time_sel_end = jmap<double>(e.x, 0, getWidth(), m_view_range.getStart(), m_view_range.getEnd()); m_time_sel_end = jmap<double>(e.x, 0, getWidth(), m_view_range.getStart(), m_view_range.getEnd());
else
{
m_time_sel_end = jmap<double>(e.x, 0, getWidth(), m_view_range.getStart(), m_view_range.getEnd());
m_time_sel_start = m_time_sel_end-curlen;
}
} }
if (m_time_sel_start > m_time_sel_end) if (m_time_sel_start > m_time_sel_end)
{ {