diff --git a/qad/blockview/blockview.cpp b/qad/blockview/blockview.cpp index 950e254..6e8a460 100644 --- a/qad/blockview/blockview.cpp +++ b/qad/blockview/blockview.cpp @@ -76,6 +76,8 @@ void BlockView::_init() { connect(&nav_anim, SIGNAL(finished()), this, SLOT(_navFinished())); connect(scene_, SIGNAL(sceneRectChanged(QRectF)), this, SLOT(adjustThumb())); connect(scene_, SIGNAL(selectionChanged()), this, SLOT(sceneSelectionChanged())); + connect(horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(updateNavRect())); + connect(verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(updateNavRect())); centerOn(scene_->sceneRect().center()); setCacheMode(CacheBackground); setTransformationAnchor(QGraphicsView::AnchorUnderMouse); @@ -1853,7 +1855,7 @@ void BlockView::_setNav(QRectF v) { matrix.scale(scl, scl); nav_rect = v; QGraphicsView::setTransform(matrix); - QGraphicsView::centerOn(nav_rect.center()); + QGraphicsView::centerOn(v.center()); } diff --git a/qad/blockview/blockview.h b/qad/blockview/blockview.h index 07696d8..d1ede0b 100644 --- a/qad/blockview/blockview.h +++ b/qad/blockview/blockview.h @@ -58,8 +58,6 @@ class BlockView: public QGraphicsView Q_PROPERTY(double _thumb READ _thumb WRITE _setThumb DESIGNABLE false SCRIPTABLE false) Q_PROPERTY(QRectF _nav READ _nav WRITE _setNav DESIGNABLE false SCRIPTABLE false) - void updateNavRect(); - public: BlockView(QWidget * parent = 0); BlockView(QGraphicsScene * scene, QWidget * parent = 0); @@ -209,6 +207,7 @@ protected slots: void removedBlock(QObject * o); void removeJunk(); void sceneSelectionChanged(); + void updateNavRect(); void _setThumb(double v); void _setNav(QRectF v); void _navFinished();