switch arg order for BM_face_other_* funcs (make face come first), and add nice ascii...
[blender.git] / source / blender / editors / mesh / loopcut.c
index 4be24e7f781ef46456acd1ae2a66959198b0f054..bbc495706ac621340afae08cd93da3e7f7f75db5 100644 (file)
@@ -133,8 +133,8 @@ static void ringsel_draw(const bContext *C, ARegion *UNUSED(ar), void *arg)
        }
 }
 
-/*given two opposite edges in a face, finds the ordering of their vertices so
-  that cut preview lines won't cross each other*/
+/* given two opposite edges in a face, finds the ordering of their vertices so
* that cut preview lines won't cross each other*/
 static void edgering_find_order(BMEditMesh *em, BMEdge *lasteed, BMEdge *eed, 
                                 BMVert *lastv1, BMVert *v[2][2])
 {
@@ -161,7 +161,7 @@ static void edgering_find_order(BMEditMesh *em, BMEdge *lasteed, BMEdge *eed,
                return;
        }
        
-       l2 = BM_face_other_loop(l->e, l->f, eed->v1);
+       l2 = BM_face_other_loop(l->f, l->e, eed->v1);
        rev = (l2 == l->prev);
        while (l2->v != lasteed->v1 && l2->v != lasteed->v2) {
                l2 = rev ? l2->prev : l2->next;
@@ -308,9 +308,9 @@ static void ringsel_finish(bContext *C, wmOperator *op)
                edgering_sel(lcd, cuts, 1);
                
                if (lcd->do_cut) {
-                       BM_mesh_esubdivideflag(lcd->ob, em->bm, BM_ELEM_SELECT, 0.0f, 
-                                         0.0f, 0, cuts, SUBDIV_SELECT_LOOPCUT, 
-                                         SUBD_PATH, 0, FALSE, 0);
+                       BM_mesh_esubdivideflag(lcd->ob, em->bm, BM_ELEM_SELECT, 0.0f,
+                                              0.0f, 0, cuts, SUBDIV_SELECT_LOOPCUT,
+                                              SUBD_PATH, 0, FALSE, 0);
                        
                        /* force edge slide to edge select mode in in face select mode */
                        if (em->selectmode & SCE_SELECT_FACE) {
@@ -373,7 +373,7 @@ static int ringsel_init (bContext *C, wmOperator *op, int do_cut)
        lcd->ar= CTX_wm_region(C);
        lcd->draw_handle= ED_region_draw_cb_activate(lcd->ar->type, ringsel_draw, lcd, REGION_DRAW_POST_VIEW);
        lcd->ob = CTX_data_edit_object(C);
-       lcd->em= ((Mesh *)lcd->ob->data)->edit_btmesh;
+       lcd->em = BMEdit_FromObject(lcd->ob);
        lcd->extend = do_cut ? 0 : RNA_boolean_get(op->ptr, "extend");
        lcd->do_cut = do_cut;