Skip to content

Commit

Permalink
Merge pull request #1048 from ahuarte47/Issue_9094-revival
Browse files Browse the repository at this point in the history
#9094-R: Use ',' and '.' keys similar to '<' and '>' keys in QgsMapToolNodeTool
  • Loading branch information
NathanW2 committed Jan 2, 2014
2 parents 9ef3f86 + 373adbd commit bb1639c
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/app/nodetool/qgsmaptoolnodetool.cpp
Expand Up @@ -733,15 +733,25 @@ void QgsMapToolNodeTool::keyPressEvent( QKeyEvent* e )
e->ignore();
}
else
if ( mSelectedFeature && ( e->key() == Qt::Key_Less || e->key() == Qt::Key_Greater ) )
{
int firstSelectedIndex = firstSelectedVertex();
if ( firstSelectedIndex == -1 ) return;
if ( mSelectedFeature && ( e->key() == Qt::Key_Less || e->key() == Qt::Key_Comma ) )
{
int firstSelectedIndex = firstSelectedVertex();
if ( firstSelectedIndex == -1) return;

mSelectedFeature->deselectAllVertexes();
safeSelectVertex( firstSelectedIndex + (( e->key() == Qt::Key_Less ) ? -1 : + 1 ) );
mCanvas->refresh();
}
mSelectedFeature->deselectAllVertexes();
safeSelectVertex( firstSelectedIndex - 1 );
mCanvas->refresh();
}
else
if ( mSelectedFeature && ( e->key() == Qt::Key_Greater || e->key() == Qt::Key_Period ) )
{
int firstSelectedIndex = firstSelectedVertex();
if ( firstSelectedIndex == -1) return;

mSelectedFeature->deselectAllVertexes();
safeSelectVertex( firstSelectedIndex + 1 );
mCanvas->refresh();
}
}

void QgsMapToolNodeTool::keyReleaseEvent( QKeyEvent* e )
Expand Down

0 comments on commit bb1639c

Please sign in to comment.