diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-07-22 16:17:46 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-07-26 09:47:48 +0300 |
commit | 40112c2d3720745b0d52b3225d9619e4dac3d126 (patch) | |
tree | db43a5b62399923a1fb942d2da195802d536261f | |
parent | 1868f2511cf388a0fbf29736640102f96bcb2acd (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.py | 10 |
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: |