diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-06-12 02:43:38 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-06-12 02:43:38 +0400 |
commit | 7b5fe4f316234022a0ab761b694cd459ce98db2d (patch) | |
tree | 587707ad84568a05c07dccde0ae45c86c034e23e /source/blender/editors/space_view3d/view3d_ruler.c | |
parent | fb6cb25c1c8797d239ca8f6c5d775eef50cc801f (diff) |
Fix flickering when transform snapping in edit mode and cursor is
slightly outside the mesh.
Reported by Thomas Beck on irc. Issue here is that the mesh bounding box
changes as we are transforming the vertices. Solution is to collide
against the initial bounding box. Unfortunately the snapping functions
are made in a way that a lot of code needed to be tweaked here, but the
change should be straightforward and harmless (famous last words, I
know).
Ideally we might want to even increase the size of the bounding box a
little (as seen in screen space) to allow snapping even in cases where,
cursor is slightly outside the bounding box, but since this is not so
straightforward to do for all cases, at least for me, leaving this as
a TODO.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_ruler.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_ruler.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/view3d_ruler.c b/source/blender/editors/space_view3d/view3d_ruler.c index 9d0a70ea9d0..6288b8c27cf 100644 --- a/source/blender/editors/space_view3d/view3d_ruler.c +++ b/source/blender/editors/space_view3d/view3d_ruler.c @@ -97,17 +97,17 @@ static bool ED_view3d_snap_co(bContext *C, float r_co[3], float r_no[3], const f /* try snap edge, then face if it fails */ if (use_vert) { ret |= snapObjectsEx(scene, NULL, v3d, ar, obedit, SCE_SNAP_MODE_VERTEX, - co_ss, &dist_px, r_co, r_no_ptr, &ray_dist, SNAP_ALL); + co_ss, &dist_px, r_co, r_no_ptr, &ray_dist, SNAP_ALL, NULL); } if (use_edge && (ret == false || use_depth)) { if (use_depth == false) ray_dist = TRANSFORM_DIST_MAX_RAY; ret |= snapObjectsEx(scene, NULL, v3d, ar, obedit, SCE_SNAP_MODE_EDGE, - co_ss, &dist_px, r_co, r_no_ptr, &ray_dist, SNAP_ALL); + co_ss, &dist_px, r_co, r_no_ptr, &ray_dist, SNAP_ALL, NULL); } if (use_face && (ret == false || use_depth)) { if (use_depth == false) ray_dist = TRANSFORM_DIST_MAX_RAY; ret |= snapObjectsEx(scene, NULL, v3d, ar, obedit, SCE_SNAP_MODE_FACE, - co_ss, &dist_px, r_co, r_no_ptr, &ray_dist, SNAP_ALL); + co_ss, &dist_px, r_co, r_no_ptr, &ray_dist, SNAP_ALL, NULL); } return ret; @@ -130,7 +130,7 @@ static bool ED_view3d_snap_ray(bContext *C, float r_co[3], ret = snapObjectsRayEx(scene, NULL, v3d, ar, obedit, SCE_SNAP_MODE_FACE, NULL, NULL, ray_start, ray_normal, &ray_dist, - NULL, &dist_px, r_co, r_no_dummy, SNAP_ALL); + NULL, &dist_px, r_co, r_no_dummy, SNAP_ALL, NULL); return ret; } |