diff options
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 4194fb2a0ad..87cc7a27829 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -144,7 +144,8 @@ static void *t_view_get(TransInfo *t) View3D *v3d = t->area->spacedata.first; return (void *)v3d; } - else if (t->region) { + + if (t->region) { return (void *)&t->region->v2d; } return NULL; @@ -158,29 +159,34 @@ static int t_around_get(TransInfo *t) } ScrArea *area = t->area; - if (t->spacetype == SPACE_VIEW3D) { - /* Bend always uses the cursor. */ - if (t->mode == TFM_BEND) { - return V3D_AROUND_CURSOR; - } - else { + switch (t->spacetype) { + case SPACE_VIEW3D: { + if (t->mode == TFM_BEND) { + /* Bend always uses the cursor. */ + return V3D_AROUND_CURSOR; + } return t->settings->transform_pivot_point; } - } - else if (t->spacetype == SPACE_IMAGE) { - SpaceImage *sima = area->spacedata.first; - return sima->around; - } - else if (t->spacetype == SPACE_GRAPH) { - SpaceGraph *sipo = area->spacedata.first; - return sipo->around; - } - else if (t->spacetype == SPACE_CLIP) { - SpaceClip *sclip = area->spacedata.first; - return sclip->around; - } - else if (t->spacetype == SPACE_SEQ && t->region->regiontype == RGN_TYPE_PREVIEW) { - return SEQ_tool_settings_pivot_point_get(t->scene); + case SPACE_IMAGE: { + SpaceImage *sima = area->spacedata.first; + return sima->around; + } + case SPACE_GRAPH: { + SpaceGraph *sipo = area->spacedata.first; + return sipo->around; + } + case SPACE_CLIP: { + SpaceClip *sclip = area->spacedata.first; + return sclip->around; + } + case SPACE_SEQ: { + if (t->region->regiontype == RGN_TYPE_PREVIEW) { + return SEQ_tool_settings_pivot_point_get(t->scene); + } + break; + } + default: + break; } return V3D_AROUND_CENTER_BOUNDS; |