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:
Diffstat (limited to 'source/blender/editors/transform/transform_constraints.c')
-rw-r--r--source/blender/editors/transform/transform_constraints.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index 14d0676786e..1e6916f0a86 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -32,17 +32,12 @@
#include <string.h>
#include <math.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifndef WIN32
#include <unistd.h>
#else
#include <io.h>
#endif
-#include "MEM_guardedalloc.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
@@ -54,7 +49,6 @@
#include "BIF_glutil.h"
#include "BKE_context.h"
-#include "BKE_global.h"
#include "BKE_utildefines.h"
#include "ED_image.h"
@@ -528,6 +522,7 @@ void setLocalConstraint(TransInfo *t, int mode, const char text[]) {
if (t->flag & T_EDIT) {
float obmat[3][3];
copy_m3_m4(obmat, t->scene->obedit->obmat);
+ normalize_m3(obmat);
setConstraint(t, obmat, mode, text);
}
else {
@@ -623,8 +618,10 @@ void drawConstraint(const struct bContext *C, TransInfo *t)
if (tc->mode & CON_SELECT) {
float vec[3];
char col2[3] = {255,255,255};
+ int depth_test_enabled;
+
convertViewVec(t, vec, (short)(t->mval[0] - t->con.imval[0]), (short)(t->mval[1] - t->con.imval[1]));
- add_v3_v3v3(vec, vec, tc->center);
+ add_v3_v3(vec, tc->center);
drawLine(t, tc->center, tc->mtx[0], 'x', 0);
drawLine(t, tc->center, tc->mtx[1], 'y', 0);
@@ -632,15 +629,18 @@ void drawConstraint(const struct bContext *C, TransInfo *t)
glColor3ubv((GLubyte *)col2);
- glDisable(GL_DEPTH_TEST);
+ depth_test_enabled = glIsEnabled(GL_DEPTH_TEST);
+ if(depth_test_enabled)
+ glDisable(GL_DEPTH_TEST);
+
setlinestyle(1);
glBegin(GL_LINE_STRIP);
glVertex3fv(tc->center);
glVertex3fv(vec);
glEnd();
setlinestyle(0);
- // TRANSFORM_FIX_ME
- //if(G.vd->zbuf)
+
+ if(depth_test_enabled)
glEnable(GL_DEPTH_TEST);
}
@@ -856,7 +856,7 @@ static void setNearestAxis3d(TransInfo *t)
mul_v3_fl(axis, zfac);
/* now we can project to get window coordinate */
- add_v3_v3v3(axis, axis, t->con.center);
+ add_v3_v3(axis, t->con.center);
projectIntView(t, axis, icoord);
axis[0] = (float)(icoord[0] - t->center2d[0]);