also allow drawing new dots when clicking inside already existing value (closes #2026120)
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1386 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
2008-07-27 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* src/gui/automation_editor.cpp:
|
||||
also allow drawing new dots when clicking inside already existing
|
||||
value (closes #2026120)
|
||||
|
||||
* include/instrument_track.h:
|
||||
* src/tracks/instrument_track.cpp:
|
||||
reverted previous change of some models from floatModel to intModel as
|
||||
|
||||
@@ -686,7 +686,8 @@ void automationEditor::drawLine( int _x0, float _y0, int _x1, float _y1 )
|
||||
m_pattern->removeValue( midiTime( x ) );
|
||||
m_pattern->putValue( midiTime( x ), y );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -730,6 +731,7 @@ void automationEditor::mousePressEvent( QMouseEvent * _me )
|
||||
len > 0 &&
|
||||
( it+1==time_map.end() ||
|
||||
pos_ticks <= (it+1).key() ) &&
|
||||
( pos_ticks<= it.key() + DefaultTicksPerTact *4 / m_ppt ) &&
|
||||
level <= it.value() )
|
||||
{
|
||||
break;
|
||||
@@ -742,9 +744,11 @@ void automationEditor::mousePressEvent( QMouseEvent * _me )
|
||||
m_editMode == DRAW )
|
||||
{
|
||||
// Connect the dots
|
||||
if( engine::getMainWindow()->isShiftPressed() == TRUE )
|
||||
if( engine::getMainWindow()->isShiftPressed() )
|
||||
{
|
||||
drawLine( m_drawLastTick, m_drawLastLevel, pos_ticks, level );
|
||||
drawLine( m_drawLastTick,
|
||||
m_drawLastLevel,
|
||||
pos_ticks, level );
|
||||
}
|
||||
m_drawLastTick = pos_ticks;
|
||||
m_drawLastLevel = level;
|
||||
@@ -811,7 +815,6 @@ void automationEditor::mousePressEvent( QMouseEvent * _me )
|
||||
else if( _me->button() == Qt::LeftButton &&
|
||||
m_editMode == MOVE )
|
||||
{
|
||||
|
||||
// move selection (including selected values)
|
||||
|
||||
// save position where move-process began
|
||||
@@ -870,17 +873,15 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me )
|
||||
return;
|
||||
}
|
||||
x -= VALUES_WIDTH;
|
||||
if( m_action == MOVE_VALUE )
|
||||
{
|
||||
x -= m_moveXOffset;
|
||||
}
|
||||
|
||||
if( m_action == MOVE_VALUE )
|
||||
{
|
||||
x -= m_moveXOffset;
|
||||
}
|
||||
int pos_ticks = x * DefaultTicksPerTact / m_ppt +
|
||||
m_currentPosition;
|
||||
if( _me->buttons() & Qt::LeftButton && m_editMode == DRAW )
|
||||
{
|
||||
/* pos_ticks = x * DefaultTicksPerTact / m_ppt +
|
||||
m_currentPosition;*/
|
||||
if( m_action == MOVE_VALUE )
|
||||
{
|
||||
// moving value
|
||||
@@ -889,7 +890,8 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me )
|
||||
pos_ticks = 0;
|
||||
}
|
||||
|
||||
drawLine( m_drawLastTick, m_drawLastLevel, pos_ticks, level );
|
||||
drawLine( m_drawLastTick, m_drawLastLevel,
|
||||
pos_ticks, level );
|
||||
m_drawLastTick = pos_ticks;
|
||||
m_drawLastLevel = level;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user