Skip to content

Commit

Permalink
Removed all referances to unused is_selected
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterSmuts committed Feb 28, 2017
1 parent d46997d commit 0031766
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 30 deletions.
3 changes: 1 addition & 2 deletions include/AutomationEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ public slots:
float getLevel( int y );
int xCoordOfTick( int tick );
float yCoordOfLevel( float level );
inline void drawLevelTick( QPainter & p, int tick,
float value, bool is_selected );
inline void drawLevelTick( QPainter & p, int tick, float value );
void removeSelection();
void selectAll();
void getSelectedValues(timeMap & selected_values );
Expand Down
31 changes: 3 additions & 28 deletions src/gui/editors/AutomationEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,6 @@ void AutomationEditor::paintEvent(QPaintEvent * pe )

if( validPattern() )
{
int len_ticks = 4;
timeMap & time_map = m_pattern->getTimeMap();

//Don't bother doing/rendering anything if there is no automation points
Expand All @@ -1287,26 +1286,6 @@ void AutomationEditor::paintEvent(QPaintEvent * pe )
break;
}

bool is_selected = false;
// if we're in move-mode, we may only draw
// values in selected area, that have originally
// been selected and not values that are now in
// selection because the user moved it...
if( m_editMode == MOVE )
{
if( m_selValuesForMove.contains( it.key() ) )
{
is_selected = true;
}
}
else if( it.value() >= selLevel_start &&
it.value() <= selLevel_end &&
it.key() >= sel_pos_start &&
it.key() + len_ticks <= sel_pos_end )
{
is_selected = true;
}

float *values = m_pattern->valuesAfter( it.key() );

float nextValue;
Expand All @@ -1320,7 +1299,6 @@ void AutomationEditor::paintEvent(QPaintEvent * pe )
path.moveTo( QPointF( xCoordOfTick( it.key() ), yCoordOfLevel( 0 ) ) );
for( int i = 0; i < ( it + 1 ).key() - it.key(); i++ )
{ path.lineTo( QPointF( xCoordOfTick( it.key() + i ), yCoordOfLevel( values[i] ) ) );
//drawLevelTick( p, it.key() + i, values[i], is_selected );

}
path.lineTo( QPointF( xCoordOfTick( ( it + 1 ).key() ), yCoordOfLevel( nextValue ) ) );
Expand All @@ -1342,7 +1320,7 @@ void AutomationEditor::paintEvent(QPaintEvent * pe )
// TODO: Find out if the section after the last control
// point is able to be selected and if so set this
// boolean correctly
drawLevelTick( p, i, it.value(), false );
drawLevelTick( p, i, it.value() );
}
// Draw circle(the last one)
drawAutomationPoint(p, it);
Expand Down Expand Up @@ -1442,8 +1420,7 @@ float AutomationEditor::yCoordOfLevel(float level )



void AutomationEditor::drawLevelTick(QPainter & p, int tick, float value,
bool is_selected )
void AutomationEditor::drawLevelTick(QPainter & p, int tick, float value )
{
int grid_bottom = height() - SCROLLBAR_SIZE - 1;
const int x = xCoordOfTick( tick );
Expand Down Expand Up @@ -1471,9 +1448,7 @@ void AutomationEditor::drawLevelTick(QPainter & p, int tick, float value,
rect_height = (int)( value * m_y_delta );
}

QBrush currentColor = is_selected
? QBrush( QColor( 0x00, 0x40, 0xC0 ) )
: graphColor();
QBrush currentColor = graphColor();

p.fillRect( x, y_start, rect_width, rect_height, currentColor );
}
Expand Down

0 comments on commit 0031766

Please sign in to comment.