Fix T38411: Free keyframe handles do not snap to frames when duplicating

This commit is contained in:
Sergey Sharybin 2014-02-04 19:12:19 +06:00
parent 5f99f8bee7
commit 1d260d84ad

@ -3802,7 +3802,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
const char sel1 = use_handle ? bezt->f1 & SELECT : sel2; const char sel1 = use_handle ? bezt->f1 & SELECT : sel2;
const char sel3 = use_handle ? bezt->f3 & SELECT : sel2; const char sel3 = use_handle ? bezt->f3 & SELECT : sel2;
if (ELEM3(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE)) { if (ELEM4(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE, TFM_TIME_DUPLICATE)) {
/* for 'normal' pivots - just include anything that is selected. /* for 'normal' pivots - just include anything that is selected.
* this works a bit differently in translation modes */ * this works a bit differently in translation modes */
if (sel2) { if (sel2) {
@ -3910,7 +3910,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
/* only include handles if selected, irrespective of the interpolation modes. /* only include handles if selected, irrespective of the interpolation modes.
* also, only treat handles specially if the center point isn't selected. * also, only treat handles specially if the center point isn't selected.
*/ */
if (!ELEM3(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE) || !(sel2)) { if (!ELEM4(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE, TFM_TIME_DUPLICATE) || !(sel2)) {
if (sel1) { if (sel1) {
hdata = initTransDataCurveHandles(td, bezt); hdata = initTransDataCurveHandles(td, bezt);
bezt_to_transdata(td++, td2d++, adt, bezt, 0, 1, 1, intvals, scaled_mtx, scaled_smtx); bezt_to_transdata(td++, td2d++, adt, bezt, 0, 1, 1, intvals, scaled_mtx, scaled_smtx);
@ -3933,7 +3933,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
if (sel2 && (use_local_center == false)) { if (sel2 && (use_local_center == false)) {
/* move handles relative to center */ /* move handles relative to center */
if (ELEM3(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE)) { if (ELEM4(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE, TFM_TIME_DUPLICATE)) {
if (sel1) td->flag |= TD_MOVEHANDLE1; if (sel1) td->flag |= TD_MOVEHANDLE1;
if (sel3) td->flag |= TD_MOVEHANDLE2; if (sel3) td->flag |= TD_MOVEHANDLE2;
} }