transform_snap_object: Add a small offset to the clip plane

This prioritizes the vertex and edge snap over raycast.
This commit is contained in:
Germano Cavalcante 2018-08-27 16:00:20 -03:00
parent 4b89bf88c7
commit 0bdabaa3f6
Notes: blender-bot 2023-02-14 06:37:09 +01:00
Referenced by issue #56577, Crash when using Grease Pencil Fill Brush
1 changed files with 3 additions and 0 deletions

View File

@ -2655,6 +2655,9 @@ static short transform_snap_context_project_view3d_mixed_impl(
negate_v4(new_clipplane);
}
/* Small offset to simulate a kind of volume for edges and vertices. */
new_clipplane[3] += 0.01f;
/* Try to snap only to the polygon. */
elem = snap_mesh_polygon(
sctx, &snapdata, ob, obmat,