Move X-ray set-up code into _checkSetup

That's what that function is meant for. It's executing essentially the same, since before it was executed right after the call to _checkSetup() and now it's at the end inside that function.

Contributes to issue CURA-7262.
This commit is contained in:
Ghostkeeper 2020-03-25 15:13:33 +01:00
parent 0150f37937
commit a4fbf3c613
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -133,12 +133,6 @@ class SolidView(View):
self._support_mesh_shader.setUniformValue("u_vertical_stripes", True)
self._support_mesh_shader.setUniformValue("u_width", 5.0)
def beginRendering(self):
scene = self.getController().getScene()
renderer = self.getRenderer()
self._checkSetup()
if not CuraApplication.getInstance().getPreferences().getValue(self._show_xray_warning_preference):
self._xray_error_image = None
self._xray_shader = None
@ -183,6 +177,12 @@ class SolidView(View):
self._old_composite_shader = self._composite_pass.getCompositeShader()
self._composite_pass.setCompositeShader(self._xray_composite_shader)
def beginRendering(self):
scene = self.getController().getScene()
renderer = self.getRenderer()
self._checkSetup()
global_container_stack = Application.getInstance().getGlobalContainerStack()
if global_container_stack:
if Application.getInstance().getPreferences().getValue("view/show_overhang"):