Skip to content

Commit e076fb6

Browse files
committed
Fix scene rect centering when expanding (paceholder#120)
1 parent ed95d02 commit e076fb6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/GraphicsView.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ GraphicsView(QWidget *parent)
4848
setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
4949

5050
//setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
51+
52+
// Sets the scene rect to its maximum possible ranges to avoid autu scene range
53+
// re-calculation when expanding the all QGraphicsItems common rect.
54+
int maxSize = 32767;
55+
setSceneRect(-maxSize, -maxSize, (maxSize * 2), (maxSize * 2));
5156
}
5257

5358

0 commit comments

Comments
 (0)