From c3e7dfa82d1734505dfb82d68690bab9544795ee Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 24 Nov 2015 12:13:49 +1100 Subject: Fix T46816: Vert/Edge snap fails at edge of bounds --- source/blender/editors/transform/transform_snap.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/editors/transform/transform_snap.c') diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 4f003830238..2251dedc268 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1546,6 +1546,13 @@ static bool snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMes * Threshold is rather high, but seems to be needed to get good behavior, see T46099. */ bb = BKE_boundbox_ensure_minimum_dimensions(bb, &bb_temp, 1e-1f); + /* Exact value here is arbitrary (ideally we would scale in pixel-space based on 'r_dist_px'), + * scale up so we can snap against verts & edges on the boundbox, see T46816. */ + if (ELEM(snap_mode, SCE_SNAP_MODE_VERTEX, SCE_SNAP_MODE_EDGE)) { + BKE_boundbox_scale(&bb_temp, bb, 1.0f + 1e-1f); + bb = &bb_temp; + } + if (!BKE_boundbox_ray_hit_check(bb, ray_start_local, ray_normal_local, &len_diff)) { return retval; } -- cgit v1.2.3