mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Simplify the expensive call to the validation state
Since the support angle needs to be between 0 and 90, we don't have to rely on the (expensive) validator. We can just check that ourselves.
This commit is contained in:
parent
80c83617bc
commit
d53bac6eb8
1 changed files with 1 additions and 2 deletions
|
@ -69,8 +69,7 @@ class SolidView(View):
|
||||||
if support_angle_stack is not None and Application.getInstance().getPreferences().getValue("view/show_overhang"):
|
if support_angle_stack is not None and Application.getInstance().getPreferences().getValue("view/show_overhang"):
|
||||||
angle = support_angle_stack.getProperty("support_angle", "value")
|
angle = support_angle_stack.getProperty("support_angle", "value")
|
||||||
# Make sure the overhang angle is valid before passing it to the shader
|
# Make sure the overhang angle is valid before passing it to the shader
|
||||||
# Note: if the overhang angle is set to its default value, it does not need to get validated (validationState = None)
|
if angle is not None and angle >= 0 and angle <= 90:
|
||||||
if angle is not None and global_container_stack.getProperty("support_angle", "validationState") in [None, ValidatorState.Valid]:
|
|
||||||
self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(90 - angle)))
|
self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(90 - angle)))
|
||||||
else:
|
else:
|
||||||
self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(0))) #Overhang angle of 0 causes no area at all to be marked as overhang.
|
self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(0))) #Overhang angle of 0 causes no area at all to be marked as overhang.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue