Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <germano.costa@ig.com.br>2021-07-22 16:17:46 +0300
committerJeroen Bakker <jeroen@blender.org>2021-07-26 09:47:48 +0300
commit40112c2d3720745b0d52b3225d9619e4dac3d126 (patch)
treedb43a5b62399923a1fb942d2da195802d536261f
parent1868f2511cf388a0fbf29736640102f96bcb2acd (diff)
Fix T89812: 'Snap_Utilities_Line' - Projection error in orthographic viewv2.93.2
-rw-r--r--mesh_snap_utilities_line/snap_context_l/mesh_drawing.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/mesh_snap_utilities_line/snap_context_l/mesh_drawing.py b/mesh_snap_utilities_line/snap_context_l/mesh_drawing.py
index 219d7311..d05becec 100644
--- a/mesh_snap_utilities_line/snap_context_l/mesh_drawing.py
+++ b/mesh_snap_utilities_line/snap_context_l/mesh_drawing.py
@@ -349,9 +349,13 @@ class GPU_Indices_Mesh():
far_ += depth_offset
near += depth_offset
- fn = (far_ - near)
- winmat[2][2] = -(far_ + near) / fn
- winmat[2][3] = (-2 * far_ * near) / fn
+ range = (far_ - near)
+ if is_persp:
+ winmat[2][2] = -(far_ + near) / range
+ winmat[2][3] = (-2 * far_ * near) / range
+ else:
+ winmat[2][3] = -(far_ + near) / range
+
gpu.matrix.load_projection_matrix(winmat)
if self.draw_edges: