[Bf-blender-cvs] [3210dfe] master: Fix for rotate-around-selection in text-edit mode
Campbell Barton
noreply at git.blender.org
Mon May 12 03:21:46 CEST 2014
Commit: 3210dfe7696aade08d14d98a22b4a8b1c3240ccf
Author: Campbell Barton
Date: Mon May 12 11:19:55 2014 +1000
https://developer.blender.org/rB3210dfe7696aade08d14d98a22b4a8b1c3240ccf
Fix for rotate-around-selection in text-edit mode
This wasn't supported and would print an error message.
===================================================================
M source/blender/editors/space_view3d/view3d_edit.c
===================================================================
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 8121a1b..c395282 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);
More information about the Bf-blender-cvs
mailing list