From 1966924467c901d541bfe3f510d21a20c29842e3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 12 Mar 2018 13:46:25 +1100 Subject: UV: internal changes to picking Nothing user visible, only things needed for multi-object support, making picking functions more flexible too. - Support passing in an initialized hit-struct, so it's possible to do multiple nearest calls on the same hit data. - Replace manhattan distance w/ squared distance so they can be compared. - Return success to detect changes to a hit-data which might already be initialized (also more readable). --- source/blender/editors/sculpt_paint/sculpt_uv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/sculpt_paint/sculpt_uv.c') diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index 5ef9d4a6499..7b636530d61 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -650,9 +650,9 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm /* we need to find the active island here */ if (do_island_optimization) { UvElement *element; - NearestHit hit; + UvNearestHit hit = UV_NEAREST_HIT_INIT; Image *ima = CTX_data_edit_image(C); - uv_find_nearest_vert(scene, ima, em, co, NULL, &hit); + uv_find_nearest_vert(scene, ima, em, co, 0.0f, &hit); element = BM_uv_element_get(data->elementMap, hit.efa, hit.l); island_index = element->island; -- cgit v1.2.3