diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-05-12 05:19:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-05-12 05:19:55 +0400 |
commit | 3210dfe7696aade08d14d98a22b4a8b1c3240ccf (patch) | |
tree | 17e8907d52b19a69909198db56a4da4db5cb03c0 /source/blender/editors | |
parent | 5db81a0695e5e2c34a3d970a97c241cb08c4f0e1 (diff) |
Fix for rotate-around-selection in text-edit mode
This wasn't supported and would print an error message.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 8121a1be380..c3952821dbd 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -35,6 +35,7 @@ #include <float.h> #include "DNA_armature_types.h" +#include "DNA_curve_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_camera_types.h" @@ -47,6 +48,7 @@ #include "BKE_camera.h" #include "BKE_context.h" +#include "BKE_font.h" #include "BKE_image.h" #include "BKE_library.h" #include "BKE_object.h" @@ -564,6 +566,21 @@ static bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3]) } is_set = true; } + else if (ob && (ob->mode & OB_MODE_EDIT) && (ob->type == OB_FONT)) { + Curve *cu = ob->data; + EditFont *ef = cu->editfont; + int i; + + zero_v3(lastofs); + for (i = 0; i < 4; i++) { + add_v2_v2(lastofs, ef->textcurs[i]); + } + mul_v2_fl(lastofs, 1.0f / 4.0f); + + mul_m4_v3(ob->obmat, lastofs); + + is_set = true; + } else { /* If there's no selection, lastofs is unmodified and last value since static */ is_set = calculateTransformCenter(C, V3D_CENTROID, lastofs, NULL); |