Permalink
Browse files

qmlui: fix 2D view grid offset on project load

  • Loading branch information...
mcallegari committed Nov 20, 2018
1 parent 8f0c7b9 commit 8f605380466f10412b5f4aadb8bba581c7a22135
Showing with 2 additions and 4 deletions.
  1. +2 −4 qmlui/qml/fixturesfunctions/2DView.qml
@@ -129,10 +129,8 @@ Rectangle
var gridWidth = View2D.cellPixels * gridSize.width
var gridHeight = View2D.cellPixels * gridSize.height
if (gridWidth < w)
twoDContents.xOffset = (w - gridWidth) / 2
if (gridHeight < height)
twoDContents.yOffset = (height - gridHeight) / 2
twoDContents.xOffset = (gridWidth < w) ? (w - gridWidth) / 2 : 0
twoDContents.yOffset = (gridHeight < height) ? (height - gridHeight) / 2 : 0
View2D.gridPosition = Qt.point(twoDContents.xOffset, twoDContents.yOffset)

0 comments on commit 8f60538

Please sign in to comment.