Cleanup: Deduplicate code

This commit is contained in:
Germano Cavalcante 2020-05-22 14:58:56 -03:00
parent 45f17e10ec
commit e8209c36e6
1 changed files with 3 additions and 17 deletions

View File

@ -640,36 +640,22 @@ void setUserConstraint(TransInfo *t, short orientation, int mode, const char fte
BLI_snprintf(text, sizeof(text), ftext, spacename);
switch (orientation) {
case V3D_ORIENT_GLOBAL: {
setConstraint(t, mode, text);
break;
}
case V3D_ORIENT_LOCAL:
setLocalConstraint(t, mode, text);
break;
case V3D_ORIENT_NORMAL:
if (checkUseAxisMatrix(t)) {
setAxisMatrixConstraint(t, mode, text);
break;
}
else {
setConstraint(t, mode, text);
}
break;
ATTR_FALLTHROUGH;
case V3D_ORIENT_GLOBAL:
case V3D_ORIENT_VIEW:
setConstraint(t, mode, text);
break;
case V3D_ORIENT_CURSOR:
setConstraint(t, mode, text);
break;
case V3D_ORIENT_GIMBAL:
setConstraint(t, mode, text);
break;
case V3D_ORIENT_CUSTOM_MATRIX:
setConstraint(t, mode, text);
break;
case V3D_ORIENT_CUSTOM:
default: {
BLI_assert(orientation >= V3D_ORIENT_CUSTOM);
setConstraint(t, mode, text);
break;
}