Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-01-05 15:12:21 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-05 15:20:33 +0400
commit99d050f88b57f4eb616542f064da8f47594559f1 (patch)
tree7907321b121c2bf78b05fe3e5b1ab410c1c22849 /source/blender/editors/space_view3d
parent42bd5d7c8081a4f4524c07cc542c772ccf0a26eb (diff)
Text3d: selection in editmode now follows rotated text along path
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c47
1 files changed, 43 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index c26a8b08bb4..93106ea9161 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -6873,6 +6873,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
set_inverted_drawing(1);
for (i = 0; i <= (selend - selstart); i++) {
SelBox *sb = &(cu->selboxes[i]);
+ float tvec[3];
if (i < (selend - selstart)) {
if (cu->selboxes[i + 1].y == sb->y)
@@ -6883,11 +6884,49 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
else {
selboxw = sb->w;
}
+
+ /* fill in xy below */
+ tvec[2] = 0.001;
+
glBegin(GL_QUADS);
- glVertex3f(sb->x, sb->y, 0.001);
- glVertex3f(sb->x + selboxw, sb->y, 0.001);
- glVertex3f(sb->x + selboxw, sb->y + sb->h, 0.001);
- glVertex3f(sb->x, sb->y + sb->h, 0.001);
+
+ if (sb->rot == 0.0f) {
+ copy_v2_fl2(tvec, sb->x, sb->y);
+ glVertex3fv(tvec);
+
+ copy_v2_fl2(tvec, sb->x + selboxw, sb->y);
+ glVertex3fv(tvec);
+
+ copy_v2_fl2(tvec, sb->x + selboxw, sb->y + sb->h);
+ glVertex3fv(tvec);
+
+ copy_v2_fl2(tvec, sb->x, sb->y + sb->h);
+ glVertex3fv(tvec);
+ }
+ else {
+ float mat[2][2];
+
+ angle_to_mat2(mat, sb->rot);
+
+ copy_v2_fl2(tvec, sb->x, sb->y);
+ glVertex3fv(tvec);
+
+ copy_v2_fl2(tvec, selboxw, 0.0f);
+ mul_m2v2(mat, tvec);
+ add_v2_v2(tvec, &sb->x);
+ glVertex3fv(tvec);
+
+ copy_v2_fl2(tvec, selboxw, sb->h);
+ mul_m2v2(mat, tvec);
+ add_v2_v2(tvec, &sb->x);
+ glVertex3fv(tvec);
+
+ copy_v2_fl2(tvec, 0.0f, sb->h);
+ mul_m2v2(mat, tvec);
+ add_v2_v2(tvec, &sb->x);
+ glVertex3fv(tvec);
+ }
+
glEnd();
}
set_inverted_drawing(0);