Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-03-12 05:46:25 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-03-12 05:57:38 +0300
commit1966924467c901d541bfe3f510d21a20c29842e3 (patch)
treea9549221176b32af95d3d582e03790d0de28a536 /source/blender/editors/sculpt_paint/sculpt_uv.c
parent2c9c22df26dfdcf03bb308fdf35294ed79c2d0e5 (diff)
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).
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_uv.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_uv.c4
1 files changed, 2 insertions, 2 deletions
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;