Skip to content

Commit

Permalink
fix rubberband when a click happened during left mouse holding
Browse files Browse the repository at this point in the history
  • Loading branch information
speillet authored and nyalldawson committed Feb 1, 2022
1 parent 68a0c93 commit 4f52108
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gui/layout/qgslayoutviewtoolselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ void QgsLayoutViewToolSelect::layoutPressEvent( QgsLayoutViewMouseEvent *event )

if ( event->button() != Qt::LeftButton )
{
if ( mIsSelecting )
{
// selection must be ended if a right button press happens, otherwise selection rubberband won't be suppress
QMouseEvent leftRelease( QMouseEvent::MouseButtonRelease, event->localPos(), Qt::LeftButton, event->buttons(), event->modifiers() );
QgsLayoutViewMouseEvent layoutLeftRelease( view(), &leftRelease );
layoutReleaseEvent( &layoutLeftRelease );
}
event->ignore();
return;
}
Expand Down
5 changes: 5 additions & 0 deletions src/gui/layout/qgslayoutviewtoolzoom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ void QgsLayoutViewToolZoom::layoutPressEvent( QgsLayoutViewMouseEvent *event )
{
if ( event->button() != Qt::LeftButton )
{
if ( mMarqueeZoom )
{
mMarqueeZoom = false;
mRubberBand->finish();
}
event->ignore();
return;
}
Expand Down

0 comments on commit 4f52108

Please sign in to comment.