diff options
author | Ton Roosendaal <ton@blender.org> | 2006-04-17 21:35:20 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-04-17 21:35:20 +0400 |
commit | 5768e9a9dda8ec941195f0e978549a0e31b0caf4 (patch) | |
tree | 127cbbfb3b9fd982bbc6ae3f0acfec25c370304a /source/blender/src/drawipo.c | |
parent | 420b6ba5e471fa224f30d1c254b2e4733a3c0e32 (diff) |
Bugfix #3683
When the 'reference shape key' (drawn yellow) was not the first key, the
channels as drawn in IpoWindow didn't match the actual shape keys.
This was caused by an exception in code that skips drawing the reference
shape when 'relative' was used.
Now I've added a rule that the first shape in a list always becomes the
reference, that way you can also edit it. To keep backwards compatibility,
this is only activated on translating the shape key lines.
Diffstat (limited to 'source/blender/src/drawipo.c')
-rw-r--r-- | source/blender/src/drawipo.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c index 11a49790580..642a7a0602e 100644 --- a/source/blender/src/drawipo.c +++ b/source/blender/src/drawipo.c @@ -93,7 +93,6 @@ #define ISPOIN3(a, b, c, d) ( (a->b) && (a->c) && (a->d) ) #define ISPOIN4(a, b, c, d, e) ( (a->b) && (a->c) && (a->d) && (a->e) ) -#define IPOBUTX 65 /* minimum pixels per gridstep */ #define IPOSTEP 35 @@ -685,6 +684,7 @@ void test_view2d(View2D *v2d, int winx, int winy) } } +#define IPOBUTX 65 static int calc_ipobuttonswidth(ScrArea *sa) { SpaceIpo *sipo= sa->spacedata.first; @@ -692,13 +692,15 @@ static int calc_ipobuttonswidth(ScrArea *sa) int ipowidth = IPOBUTX; int a; + /* default width when no space ipo or no channels */ if (sipo == NULL) return IPOBUTX; - if ((sipo->totipo==0) || (sipo->editipo==0)) return IPOBUTX; - + if ((sipo->totipo==0) || (sipo->editipo==NULL)) return IPOBUTX; + ei= sipo->editipo; for(a=0; a<sipo->totipo; a++, ei++) { - if (BMF_GetStringWidth(G.font, ei->name) + 18 > ipowidth) ipowidth = BMF_GetStringWidth(G.font, ei->name) + 18; + if (BMF_GetStringWidth(G.font, ei->name) + 18 > ipowidth) + ipowidth = BMF_GetStringWidth(G.font, ei->name) + 18; } return ipowidth; @@ -2016,6 +2018,8 @@ void drawipospace(ScrArea *sa, void *spacedata) uiFreeBlocksWin(&sa->uiblocks, sa->win); /* for panel handler to work */ + test_editipo(0); /* test if current editipo is correct, make_editipo sets v2d->cur, call here because of calc_ipobuttonswidth() */ + v2d->hor.xmax+=calc_ipobuttonswidth(sa); calc_scrollrcts(sa, G.v2d, sa->winx, sa->winy); @@ -2038,8 +2042,6 @@ void drawipospace(ScrArea *sa, void *spacedata) } } - test_editipo(0); /* test if current editipo is correct, make_editipo sets v2d->cur */ - myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax); if(sipo->editipo) { |