Fix T62684: Crash transforming w/ snap enabled

This commit is contained in:
2019-03-18 13:42:53 +11:00
parent e1364b21fa
commit c7a50d84b6

View File

@@ -1220,6 +1220,7 @@ static short snap_mesh_polygon(
l_iter = l_first = BM_FACE_FIRST_LOOP(f);
if (snapdata->snap_to_flag & SCE_SNAP_MODE_EDGE) {
elem = SCE_SNAP_MODE_EDGE;
BM_mesh_elem_index_ensure(em->bm, BM_EDGE);
BM_mesh_elem_table_ensure(em->bm, BM_VERT | BM_EDGE);
do {
cb_snap_edge(
@@ -1231,6 +1232,7 @@ static short snap_mesh_polygon(
}
else {
elem = SCE_SNAP_MODE_VERTEX;
BM_mesh_elem_index_ensure(em->bm, BM_VERT);
BM_mesh_elem_table_ensure(em->bm, BM_VERT);
do {
cb_snap_vert(