diff options
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_convert.c | 13 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_convert.h | 4 |
2 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/editors/transform/transform_convert.c b/source/blender/editors/transform/transform_convert.c index 094ae080de0..d756e2c90a6 100644 --- a/source/blender/editors/transform/transform_convert.c +++ b/source/blender/editors/transform/transform_convert.c @@ -1662,20 +1662,23 @@ void animrecord_check_state(TransInfo *t, struct Object *ob) } } -void transform_convert_flush_handle2D(TransData *td, TransData2D *td2d, const float inv_unit_scale) +void transform_convert_flush_handle2D(TransData *td, TransData2D *td2d, const float y_fac) { + float delta_x = td->loc[0] - td->iloc[0]; + float delta_y = (td->loc[1] - td->iloc[1]) * y_fac; + /* If the handles are to be moved too * (as side-effect of keyframes moving, to keep the general effect) * offset them by the same amount so that the general angles are maintained * (i.e. won't change while handles are free-to-roam and keyframes are snap-locked). */ if ((td->flag & TD_MOVEHANDLE1) && td2d->h1) { - td2d->h1[0] = td2d->ih1[0] + td->loc[0] - td->iloc[0]; - td2d->h1[1] = td2d->ih1[1] + (td->loc[1] - td->iloc[1]) * inv_unit_scale; + td2d->h1[0] = td2d->ih1[0] + delta_x; + td2d->h1[1] = td2d->ih1[1] + delta_y; } if ((td->flag & TD_MOVEHANDLE2) && td2d->h2) { - td2d->h2[0] = td2d->ih2[0] + td->loc[0] - td->iloc[0]; - td2d->h2[1] = td2d->ih2[1] + (td->loc[1] - td->iloc[1]) * inv_unit_scale; + td2d->h2[0] = td2d->ih2[0] + delta_x; + td2d->h2[1] = td2d->ih2[1] + delta_y; } } diff --git a/source/blender/editors/transform/transform_convert.h b/source/blender/editors/transform/transform_convert.h index fa34e2555d6..9cb0400cad9 100644 --- a/source/blender/editors/transform/transform_convert.h +++ b/source/blender/editors/transform/transform_convert.h @@ -43,9 +43,7 @@ void sort_trans_data_dist(TransInfo *t); void createTransData(struct bContext *C, TransInfo *t); bool clipUVTransform(TransInfo *t, float vec[2], const bool resize); void clipUVData(TransInfo *t); -void transform_convert_flush_handle2D(TransData *td, - TransData2D *td2d, - const float inv_unit_scale); +void transform_convert_flush_handle2D(TransData *td, TransData2D *td2d, const float y_fac); void recalcData(TransInfo *t); /* transform_convert_mesh.c */ |