Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and YoannQDQ committed Dec 15, 2024
1 parent 7553bef commit 5e37b15
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/gui/layout/qgslayoutview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -633,15 +633,14 @@ void QgsLayoutView::emitZoomLevelChanged()

void QgsLayoutView::onExtentChanged()
{

//clear all transforms items after current index
mLastTransform = mLastTransform.mid( 0, mLastTransformIndex + 1 );

QPointF center = mapToScene( viewport()->rect().center() );

if ( mLastTransform.isEmpty() || mLastTransform.last().second != transform() || mLastTransform.last().first != center )
{
mLastTransform.append( {center, transform()} );
mLastTransform.append( { center, transform() } );
}

// adjust history to no more than 100
Expand Down Expand Up @@ -1048,7 +1047,6 @@ void QgsLayoutView::mouseReleaseEvent( QMouseEvent *event )

if ( !mTool || !event->isAccepted() )
{

if ( event->button() == Qt::BackButton )
{
zoomLast();
Expand Down Expand Up @@ -1337,7 +1335,6 @@ bool QgsLayoutView::eventFilter( QObject *object, QEvent *event )
emit extentChanged();
}
return QGraphicsView::eventFilter( object, event );

}

QGraphicsLineItem *QgsLayoutView::createSnapLine() const
Expand Down
2 changes: 1 addition & 1 deletion src/gui/layout/qgslayoutview.h
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ class GUI_EXPORT QgsLayoutView : public QGraphicsView
QGraphicsLineItem *createSnapLine() const;

//! recently used extent
QList <QPair<QPointF, QTransform>> mLastTransform;
QList<QPair<QPointF, QTransform>> mLastTransform;
int mLastTransformIndex = -1;
};

Expand Down
2 changes: 1 addition & 1 deletion src/gui/layout/qgslayoutviewtoolpan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void QgsLayoutViewToolPan::layoutReleaseEvent( QgsLayoutViewMouseEvent *event )
}

mIsPanning = false;
emit view()->extentChanged();
emit view() -> extentChanged();
view()->viewport()->setCursor( Qt::OpenHandCursor );
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/layout/qgslayoutviewtooltemporarykeypan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void QgsLayoutViewToolTemporaryKeyPan::keyReleaseEvent( QKeyEvent *event )
if ( event->key() == Qt::Key_Space && !event->isAutoRepeat() )
{
view()->setTool( mPreviousViewTool );
emit view()->extentChanged();
emit view() -> extentChanged();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/layout/qgslayoutviewtooltemporarymousepan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void QgsLayoutViewToolTemporaryMousePan::layoutReleaseEvent( QgsLayoutViewMouseE
if ( event->button() == Qt::MiddleButton )
{
view()->setTool( mPreviousViewTool );
emit view()->extentChanged();
emit view() -> extentChanged();
}
}

Expand Down

0 comments on commit 5e37b15

Please sign in to comment.