diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/transform/transform.h | 8 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_constraints.c | 11 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_unwrap_ops.c | 4 |
3 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 4d88f3d8b36..28264a44bcf 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -102,15 +102,15 @@ typedef struct TransCon { int imval[2]; /* initial mouse value for visual calculation */ /* the one in TransInfo is not garanty to stay the same (Rotates change it) */ int mode; /* Mode flags of the Constraint */ - void (*drawExtra)(struct TransInfo *); + void (*drawExtra)(struct TransInfo *t); /* For constraints that needs to draw differently from the other * uses this instead of the generic draw function */ - void (*applyVec)(struct TransInfo *, struct TransData *, float *, float *, float *); + void (*applyVec)(struct TransInfo *t, struct TransData *td, const float in[3], float out[3], float pvec[3]); /* Apply function pointer for linear vectorial transformation */ /* The last three parameters are pointers to the in/out/printable vectors */ - void (*applySize)(struct TransInfo *, struct TransData *, float [3][3]); + void (*applySize)(struct TransInfo *t, struct TransData *td, float [3][3]); /* Apply function pointer for size transformation */ - void (*applyRot)(struct TransInfo *, struct TransData *, float [3], float *); + void (*applyRot)(struct TransInfo *t, struct TransData *td, float vec[3], float *angle); /* Apply function pointer for rotation transformation */ } TransCon; diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 947bdf53bee..097e4592933 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -200,13 +200,14 @@ static void viewAxisCorrectCenter(TransInfo *t, float t_con_center[3]) } } -static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3]) +static void axisProjection(TransInfo *t, const float axis[3], const float in[3], float out[3]) { float norm[3], vec[3], factor, angle; float t_con_center[3]; - if (in[0] == 0.0f && in[1] == 0.0f && in[2] == 0.0f) + if (is_zero_v3(in)) { return; + } copy_v3_v3(t_con_center, t->con.center); @@ -278,7 +279,7 @@ static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3 } } -static void planeProjection(TransInfo *t, float in[3], float out[3]) +static void planeProjection(TransInfo *t, const float in[3], float out[3]) { float vec[3], factor, norm[3]; @@ -308,7 +309,7 @@ static void planeProjection(TransInfo *t, float in[3], float out[3]) * */ -static void applyAxisConstraintVec(TransInfo *t, TransData *td, float in[3], float out[3], float pvec[3]) +static void applyAxisConstraintVec(TransInfo *t, TransData *td, const float in[3], float out[3], float pvec[3]) { copy_v3_v3(out, in); if (!td && t->con.mode & CON_APPLY) { @@ -351,7 +352,7 @@ static void applyAxisConstraintVec(TransInfo *t, TransData *td, float in[3], flo * Further down, that vector is mapped to each data's space. */ -static void applyObjectConstraintVec(TransInfo *t, TransData *td, float in[3], float out[3], float pvec[3]) +static void applyObjectConstraintVec(TransInfo *t, TransData *td, const float in[3], float out[3], float pvec[3]) { copy_v3_v3(out, in); if (t->con.mode & CON_APPLY) { diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index e9cf822a267..00b82e26a05 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -686,7 +686,7 @@ static int minimize_stretch_modal(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_FINISHED; case PADPLUSKEY: case WHEELUPMOUSE: - if(event->val == KM_PRESS) { + if (event->val == KM_PRESS) { if (ms->blend < 0.95f) { ms->blend += 0.1f; ms->lasttime = 0.0f; @@ -697,7 +697,7 @@ static int minimize_stretch_modal(bContext *C, wmOperator *op, wmEvent *event) break; case PADMINUS: case WHEELDOWNMOUSE: - if(event->val == KM_PRESS) { + if (event->val == KM_PRESS) { if (ms->blend > 0.05f) { ms->blend -= 0.1f; ms->lasttime = 0.0f; |