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>2010-11-05 08:26:34 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-05 08:26:34 +0300
commit7569a25a4f00575c690968eeb0ff53b6b4ab890b (patch)
tree73eda26f3ef63a271911e0ac99f6d1f20c6eba04 /source/blender/editors/transform
parent36b8ebceb5020c0b697f4b3d23a3ac319ea5ab53 (diff)
centralize function for calculating pixel size. (no functional changes)
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform.h1
-rw-r--r--source/blender/editors/transform/transform_generics.c14
-rw-r--r--source/blender/editors/transform/transform_manipulator.c13
-rw-r--r--source/blender/editors/transform/transform_snap.c6
4 files changed, 4 insertions, 30 deletions
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index ec18b2f81a0..b9f3382e9d3 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -557,7 +557,6 @@ void flushTransSeq(TransInfo *t);
/*********************** exported from transform_manipulator.c ********** */
int gimbal_axis(struct Object *ob, float gmat[][3]); /* return 0 when no gimbal for selection */
int calc_manipulator_stats(const struct bContext *C);
-float get_drawsize(struct ARegion *ar, float *co);
/*********************** TransData Creation and General Handling *********** */
void createTransData(struct bContext *C, TransInfo *t);
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 7ff93be87ee..22888a6b007 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1568,17 +1568,3 @@ void calculatePropRatio(TransInfo *t)
strcpy(t->proptext, "");
}
}
-
-float get_drawsize(ARegion *ar, float *co)
-{
- RegionView3D *rv3d= ar->regiondata;
- float size= rv3d->pixsize * 5;
- float vec[3];
-
- vec[0]= rv3d->persmat[0][3];
- vec[1]= rv3d->persmat[1][3];
- vec[2]= rv3d->persmat[2][3];
-
- size *= dot_v3v3(vec, co) + rv3d->persmat[3][3];
- return size;
-}
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index 23b4cf5fd99..7ed569dab93 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -1401,17 +1401,6 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
/* ********************************************* */
-static float get_manipulator_drawsize(ARegion *ar)
-{
- RegionView3D *rv3d= ar->regiondata;
- float size = get_drawsize(ar, rv3d->twmat[3]);
-
- size*= (float)U.tw_size;
-
- return size;
-}
-
-
/* main call, does calc centers & orientation too */
/* uses global G.moving */
static int drawflags= 0xFFFF; // only for the calls below, belongs in scene...?
@@ -1459,7 +1448,7 @@ void BIF_draw_manipulator(const bContext *C)
break;
}
- mul_mat3_m4_fl(rv3d->twmat, get_manipulator_drawsize(ar));
+ mul_mat3_m4_fl(rv3d->twmat, view3d_pixel_size(rv3d, rv3d->twmat[3]) * U.tw_size * 5.0f);
}
test_manipulator_axis(C);
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index adaaf7c9de6..06a2db527fd 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -146,16 +146,16 @@ void drawSnapping(const struct bContext *C, TransInfo *t)
glDisable(GL_DEPTH_TEST);
- size = 0.5f * UI_GetThemeValuef(TH_VERTEX_SIZE);
+ size = 2.5f * UI_GetThemeValuef(TH_VERTEX_SIZE);
invert_m4_m4(imat, rv3d->viewmat);
for (p = t->tsnap.points.first; p; p = p->next) {
- drawcircball(GL_LINE_LOOP, p->co, size * get_drawsize(t->ar, p->co), imat);
+ drawcircball(GL_LINE_LOOP, p->co, view3d_pixel_size(rv3d, p->co) * size, imat);
}
if (t->tsnap.status & POINT_INIT) {
- drawcircball(GL_LINE_LOOP, t->tsnap.snapPoint, size * get_drawsize(t->ar, t->tsnap.snapPoint), imat);
+ drawcircball(GL_LINE_LOOP, t->tsnap.snapPoint, view3d_pixel_size(rv3d, t->tsnap.snapPoint) * size, imat);
}
/* draw normal if needed */