Browse Source

Improve time selection dragging behavior

tags/1.0.2
xenakios 7 years ago
parent
commit
3c20facdbc
2 changed files with 5 additions and 2 deletions
  1. +4
    -2
      Source/PluginEditor.cpp
  2. +1
    -0
      Source/PluginEditor.h

+ 4
- 2
Source/PluginEditor.cpp View File

@@ -596,6 +596,7 @@ void WaveformComponent::mouseDown(const MouseEvent & e)

void WaveformComponent::mouseUp(const MouseEvent & /*e*/)
{
m_is_dragging_selection = false;
m_lock_timesel_set = false;
m_mousedown = false;
m_didseek = false;
@@ -610,14 +611,15 @@ void WaveformComponent::mouseDrag(const MouseEvent & e)
{
if (m_didseek == true)
return;
if (m_time_sel_drag_target == 0 && e.y>=50)
if (m_time_sel_drag_target == 0 && e.y>=50 && m_is_dragging_selection==false)
{
m_time_sel_start = m_drag_time_start;
m_time_sel_end = viewXToNormalized(e.x);
}
double curlen = m_time_sel_end - m_time_sel_start;
if (m_time_sel_drag_target == 0 && e.y<50 && m_is_at_selection_drag_area)
if (m_time_sel_drag_target == 0 && m_is_at_selection_drag_area)
{
m_is_dragging_selection = true;
double diff = m_drag_time_start - viewXToNormalized(e.x);
m_time_sel_start = jlimit<double>(0.0, 1.0-curlen, m_time_sel_start - diff);
m_time_sel_end = jlimit<double>(curlen, 1.0, m_time_sel_end - diff);


+ 1
- 0
Source/PluginEditor.h View File

@@ -168,6 +168,7 @@ private:
bool m_lock_timesel_set = false;
bool m_using_audio_buffer = false;
bool m_is_at_selection_drag_area = false;
bool m_is_dragging_selection = false;
void updateCachedImage();
double viewXToNormalized(double xcor)
{


Loading…
Cancel
Save