Bugfix: "Time Slide" tool broken

Dunno how long this has been broken for (*), but the Time Slide
transform tool in DopeSheet no longer did anything most of the time.
It appeared to be be caused by some blotched indexing code from ages
ago. I've fixed this problem, as well as preventing the case where it
would also give errors when only a single key was selected.

(*) Does anyone actually use this tool? IIRC, this was added during
Orange, though I can't find the commit for this anymore or why it was
added. Probably it might be better to just let it go...
This commit is contained in:
2011-06-02 11:51:38 +00:00
parent dd43faa855
commit b41427c66b
2 changed files with 16 additions and 7 deletions

View File

@@ -3129,12 +3129,21 @@ static void createTransActionData(bContext *C, TransInfo *t)
/* check if we're supposed to be setting minx/maxx for TimeSlide */
if (t->mode == TFM_TIME_SLIDE) {
float min=999999999.0f, max=-999999999.0f;
int i;
td= (t->data + 1);
for (i=1; i < count; i+=3, td+=3) {
if (min > *(td->val)) min= *(td->val);
if (max < *(td->val)) max= *(td->val);
if (count > 1) {
/* search for min/max selected values to transform */
int i;
td= t->data;
for (i=0; i < count; i++, td++) {
if (min > *(td->val)) min= *(td->val);
if (max < *(td->val)) max= *(td->val);
}
}
else {
/* just use the current frame ranges */
min = (float)PSFRA;
max = (float)PEFRA;
}
/* minx/maxx values used by TimeSlide are stored as a