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:
-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: