snap_context module: Fix depth_range in Ortho view

Objects behind the coordinate `(0, 0, 0)` were being ignored with snap in Ortho view
This commit is contained in:
Germano Cavalcante 2017-09-18 18:18:18 -03:00
parent d73913205c
commit 756188a459
1 changed files with 6 additions and 1 deletions

View File

@ -53,8 +53,13 @@ class SnapContext():
self._offset_cur = 1 # Starts with index 1
self.region = region
self.rv3d = space.region_3d
if self.rv3d.is_perspective:
self.depth_range = Vector((space.clip_start, space.clip_end))
else:
self.depth_range = Vector((-space.clip_end, space.clip_end))
self.proj_mat = Matrix.Identity(4)
self.depth_range = Vector((space.clip_start, space.clip_end))
self.mval = Vector((0, 0))
self._snap_mode = VERT | EDGE | FACE