Fix T80426: Crash when deleting custom orientation

Indices referencing other orientations were not being updated,
This commit is contained in:
Germano Cavalcante 2020-09-04 15:01:04 -03:00
parent 1767a7c986
commit e43d482cc9
1 changed files with 4 additions and 0 deletions

View File

@ -2424,6 +2424,10 @@ void BKE_scene_transform_orientation_remove(Scene *scene, TransformOrientation *
orient_slot->type = V3D_ORIENT_GLOBAL;
orient_slot->index_custom = -1;
}
else if (orient_slot->index_custom > orientation_index) {
BLI_assert(orient_slot->type == V3D_ORIENT_CUSTOM);
orient_slot->index_custom--;
}
}
BLI_freelinkN(&scene->transform_spaces, orientation);