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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-11-26 23:10:34 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-11-26 23:10:34 +0400
commit864c4112e9ac6891b58e94e563e2342ea1d895b8 (patch)
tree2cdf4fa6fed0a815c93c805c1dfc6d09f961f3fa /source/blender/editors/mesh
parentc71ab7e774aa17651d4604110eba894dc1c009ba (diff)
Fix #33316: mesh edge short path select was wrong on large/small objects.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editmesh_select.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index a6b798c8887..b46961a95d7 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -1267,12 +1267,12 @@ static float step_cost_3_v3(const float v1[3], const float v2[3], const float v3
/* The cost is based on the simple sum of the length of the two edgees... */
sub_v3_v3v3(d1, v2, v1);
sub_v3_v3v3(d2, v3, v2);
- cost = len_v3(d1) + len_v3(d2);
+ cost = normalize_v3(d1) + normalize_v3(d2);
/* but is biased to give higher values to sharp turns, so that it will take
* paths with fewer "turns" when selecting between equal-weighted paths between
* the two edges */
- cost = cost + 0.5f * cost * (2.0f - sqrtf(fabsf(dot_v3v3(d1, d2))));
+ cost = cost * (1.0f + 0.5f * (2.0f - sqrtf(fabsf(dot_v3v3(d1, d2)))));
return cost;
}