Fix camera position before adding a printer

Don't use the diagonal size then, because that returns 0.
This commit is contained in:
Ghostkeeper 2018-08-17 09:57:37 +02:00
parent 013032279d
commit 284f90f3ff
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -780,7 +780,10 @@ class CuraApplication(QtApplication):
# Initialize camera
root = controller.getScene().getRoot()
camera = Camera("3d", root)
camera.setPosition(Vector(-80, 250, 700) * self.getBuildVolume().getDiagonalSize() / 375)
diagonal = self.getBuildVolume().getDiagonalSize()
if diagonal < 1: #No printer added yet. Set a default camera distance for normal-sized printers.
diagonal = 375
camera.setPosition(Vector(-80, 250, 700) * diagonal / 375)
camera.setPerspective(True)
camera.lookAt(Vector(0, 0, 0))
controller.getScene().setActiveCamera("3d")