Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph: add Control+click feature for compressor usage #3140

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions src/gui/widgets/Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,28 +159,48 @@ void Graph::mousePressEvent( QMouseEvent * _me )
{
if( _me->button() == Qt::LeftButton )
{
if ( !( _me->modifiers() & Qt::ShiftModifier ) )
if ( _me->modifiers() & Qt::ShiftModifier )
{
// get position
//when shift-clicking, draw a line from last position to current
//position
int x = _me->x();
int y = _me->y();

changeSampleAt( x, y );
drawLineAt( x, y, m_lastCursorX );

m_mouseDown = true;
setCursor( Qt::BlankCursor );
m_lastCursorX = x;
}
else if ( _me->modifiers() & Qt::ControlModifier )
{
//when control-clicking, draw a line from 0 to current and a line
//from current to max value

int x = _me->x();
int y = _me->y();

changeSampleAt( 0, height() - 1 );
changeSampleAt( width() - 1, 0 );
drawLineAt(x, y, 0);
drawLineAt(x, y, width() - 1);

// toggle mouse state
m_mouseDown = true;
setCursor( Qt::BlankCursor );
m_lastCursorX = x;

}
else
{
//when shift-clicking, draw a line from last position to current
//position

// get position
int x = _me->x();
int y = _me->y();

drawLineAt( x, y, m_lastCursorX );
changeSampleAt( x, y );

// toggle mouse state
m_mouseDown = true;
setCursor( Qt::BlankCursor );
m_lastCursorX = x;
Expand Down