ensure pasted graph keys are always selected.

This commit is contained in:
2010-12-15 17:36:08 +00:00
parent 6b2b56c35e
commit 7e10a9e6ce
4 changed files with 14 additions and 5 deletions

View File

@@ -515,7 +515,7 @@ short copy_animedit_keys (bAnimContext *ac, ListBase *anim_data)
for (ale= anim_data->first; ale; ale= ale->next) {
FCurve *fcu= (FCurve *)ale->key_data;
tAnimCopybufItem *aci;
BezTriple *bezt, *newbuf;
BezTriple *bezt, *nbezt, *newbuf;
int i;
/* firstly, check if F-Curve has any selected keyframes
@@ -546,8 +546,14 @@ short copy_animedit_keys (bAnimContext *ac, ListBase *anim_data)
memcpy(newbuf, aci->bezt, sizeof(BezTriple)*(aci->totvert));
/* copy current beztriple across too */
*(newbuf + aci->totvert)= *bezt;
nbezt= &newbuf[aci->totvert];
*nbezt= *bezt;
/* ensure copy buffer is selected so pasted keys are selected */
nbezt->f1 |= SELECT;
nbezt->f2 |= SELECT;
nbezt->f3 |= SELECT;
/* free old array and set the new */
if (aci->bezt) MEM_freeN(aci->bezt);
aci->bezt= newbuf;