Fix rest of #28693: Proportional edit hangs on mesh object with high scale
[blender.git] / source / blender / editors / transform / transform_conversions.c
index 77d2e6e7ff07a6bcadd417fd4f0cffdeb33a4eca..83f79eae4f2581bc0b1210d7ee9fe5854bb9ff52 100644 (file)
@@ -1807,7 +1807,7 @@ void flushTransParticles(TransInfo *t)
 /* ********************* mesh ****************** */
 
 /* proportional distance based on connectivity  */
-#define THRESHOLD      0.0001f
+#define THRESHOLDFACTOR (1.0f-0.0001f)
 
 static int connectivity_edge(float mtx[][3], EditVert *v1, EditVert *v2)
 {
@@ -1828,10 +1828,10 @@ static int connectivity_edge(float mtx[][3], EditVert *v1, EditVert *v2)
 
        if (v1->f2) {
                if (v2->f2) {
-                       if (v2->tmp.fp + edge_len + THRESHOLD < v1->tmp.fp) {
+                       if (v2->tmp.fp + edge_len < THRESHOLDFACTOR * v1->tmp.fp) {
                                v1->tmp.fp = v2->tmp.fp + edge_len;
                                done = 1;
-                       } else if (v1->tmp.fp + edge_len + THRESHOLD < v2->tmp.fp) {
+                       } else if (v1->tmp.fp + edge_len < THRESHOLDFACTOR * v2->tmp.fp) {
                                v2->tmp.fp = v1->tmp.fp + edge_len;
                                done = 1;
                        }