Skip to content

Commit

Permalink
Show snapped cursor position in status bar
Browse files Browse the repository at this point in the history
  • 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
Original file line number Diff line number Diff line change
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.