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>2012-02-03 06:36:03 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-02-03 06:36:03 +0400
commit995f1e519c69d5aab47ee2a158dc7abe1bfc4bde (patch)
tree848473bba9423193713bc99717b7500292fec934 /source/blender/editors/space_view3d/view3d_snap.c
parent26fd713906baf3aebcba5087c83261ad5ce9fdf2 (diff)
fix [#30057] Bezier Curve bad centering
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_snap.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_snap.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c
index 2e8ddbbede4..7cb64977a28 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -86,9 +86,11 @@ typedef struct TransVert {
float *val, oldval;
int flag;
float *nor;
- int f1;
} TransVert;
+ /* SELECT == (1 << 0) */
+#define TX_VERT_USE_MAPLOC (1 << 1)
+
static TransVert *transvmain=NULL;
static int tottrans= 0;
@@ -198,9 +200,9 @@ static void set_mapped_co(void *vuserdata, int index, float *co, float *UNUSED(n
TransVert *tv = userdata[1];
BMVert *eve = EDBM_get_vert_for_index(em, index);
- if (BM_GetIndex(eve) != -1 && !tv[BM_GetIndex(eve)].f1) {
+ if (BM_GetIndex(eve) != -1 && !(tv[BM_GetIndex(eve)].flag & TX_VERT_USE_MAPLOC)) {
copy_v3_v3(tv[BM_GetIndex(eve)].maploc, co);
- tv[BM_GetIndex(eve)].f1 = 1;
+ tv[BM_GetIndex(eve)].flag |= TX_VERT_USE_MAPLOC;
}
}
@@ -312,11 +314,6 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
EDBM_init_index_arrays(em, 1, 0, 0);
em->derivedCage->foreachMappedVert(em->derivedCage, set_mapped_co, userdata);
EDBM_free_index_arrays(em);
- } else if (transvmain) {
- tv = transvmain;
- for (a=0; a<tottrans; a++, tv++) {
- copy_v3_v3(tv->maploc, tv->loc);
- }
}
}
else if (obedit->type==OB_ARMATURE){
@@ -1072,7 +1069,7 @@ int minmax_verts(Object *obedit, float *min, float *max)
tv= transvmain;
for(a=0; a<tottrans; a++, tv++) {
- copy_v3_v3(vec, tv->maploc);
+ copy_v3_v3(vec, (tv->flag & TX_VERT_USE_MAPLOC) ? tv->maploc : tv->loc);
mul_m3_v3(bmat, vec);
add_v3_v3(vec, obedit->obmat[3]);
add_v3_v3(centroid, vec);