Cleanup: style, whitespace, doxy filepaths
[blender-staging.git] / source / blender / editors / mesh / editmesh_knife.c
index 59967ffb2bb965a0da34e9e6ffdc7fdd05af1e86..a84b8d9dcc82f21644b5c82fb2793698aa754a2c 100644 (file)
@@ -1625,8 +1625,11 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd)
                face_tol = KNIFE_FLT_EPS_PX_FACE;
        }
        else {
-               /* use 1/100th of a pixel, see T43896 (too big), T47910 (too small). */
-               vert_tol = line_tol = face_tol = 0.01f;
+               /* Use 1/100th of a pixel, see T43896 (too big), T47910 (too small).
+                *
+                * Update, leave this as is until we investigate not using pixel coords for geometry calculations: T48023
+                */
+               vert_tol = line_tol = face_tol = 0.5f;
        }
 
        vert_tol_sq = vert_tol * vert_tol;
@@ -2276,15 +2279,11 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMFace *f, ListBase *kfe
        KnifeEdge *kfe;
        Ref *ref;
        int edge_array_len = BLI_listbase_count(kfedges);
-       bool ok;
        int i;
 
-       BMFace **face_arr;
-       int face_arr_len;
-
        BMEdge **edge_array = BLI_array_alloca(edge_array, edge_array_len);
 
-        /* point to knife edges we've created edges in, edge_array aligned */
+       /* point to knife edges we've created edges in, edge_array aligned */
        KnifeEdge **kfe_array = BLI_array_alloca(kfe_array, edge_array_len);
 
        BLI_assert(BLI_gset_size(kcd->edgenet.edge_visit) == 0);
@@ -2357,12 +2356,17 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMFace *f, ListBase *kfe
                }
 #endif
 
-               ok = BM_face_split_edgenet(
-                        bm, f, edge_array, edge_array_len,
-                        &face_arr, &face_arr_len);
+               {
+                       BMFace **face_arr = NULL;
+                       int face_arr_len;
+
+                       BM_face_split_edgenet(
+                               bm, f, edge_array, edge_array_len,
+                               &face_arr, &face_arr_len);
 
-               if (ok) {
-                       MEM_freeN(face_arr);
+                       if (face_arr) {
+                               MEM_freeN(face_arr);
+                       }
                }
 
                /* remove dangling edges, not essential - but nice for users */