Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Show snapped cursor position in status bar
  • Loading branch information
nyalldawson committed Aug 7, 2017
1 parent 3dbc1a0 commit 3aa231e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/gui/layout/qgslayoutview.cpp
Expand Up @@ -268,9 +268,7 @@ void QgsLayoutView::mouseMoveEvent( QMouseEvent *event )
{
mMouseCurrentXY = event->pos();

//update cursor position in status bar
emit cursorPosChanged( mapToScene( mMouseCurrentXY ) );

QPointF cursorPos = mapToScene( mMouseCurrentXY );
if ( mTool )
{
std::unique_ptr<QgsLayoutViewMouseEvent> me( new QgsLayoutViewMouseEvent( this, event, mTool->flags() & QgsLayoutViewTool::FlagSnaps ) );
Expand All @@ -279,6 +277,7 @@ void QgsLayoutView::mouseMoveEvent( QMouseEvent *event )
//draw snapping point indicator
if ( me->isSnapped() )
{
cursorPos = me->snappedPoint();
mSnapMarker->setPos( me->snappedPoint() );
mSnapMarker->setVisible( true );
}
Expand All @@ -289,6 +288,9 @@ void QgsLayoutView::mouseMoveEvent( QMouseEvent *event )
event->setAccepted( me->isAccepted() );
}

//update cursor position in status bar
emit cursorPosChanged( cursorPos );

if ( !mTool || !event->isAccepted() )
QGraphicsView::mouseMoveEvent( event );
}
Expand Down

0 comments on commit 3aa231e

Please sign in to comment.