DopeSheet and NLA Editor Scrollbar/View Bugs:

Fixed some long-standing bugs with DopeSheet and NLA Editor main views not being properly lined up with their channels, and/or showing an incorrect scrollbar. 

This fixes #20759, and probably a few other reports about similar issues that might've cropped up.

NOTE: 
- probably a version bump might be needed after this, to avoid problems on durian animation files?
- the default .b.blend needs updating again, since the saved config there doesn't get updated (or doesn't here, when using load factory settings)
This commit is contained in:
2010-01-27 11:43:34 +00:00
parent 7a95905902
commit f84f96aee5
3 changed files with 37 additions and 7 deletions

View File

@@ -6226,6 +6226,9 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
SpaceNla *snla= (SpaceNla *)sl;
memcpy(&ar->v2d, &snla->v2d, sizeof(View2D));
ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f;
ar->v2d.tot.ymax= 0.0f;
ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
ar->v2d.align = V2D_ALIGN_NO_POS_Y;
@@ -6236,7 +6239,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
{
/* we totally reinit the view for the Action Editor, as some old instances had some weird cruft set */
ar->v2d.tot.xmin= -20.0f;
ar->v2d.tot.ymin= (float)(-sa->winy);
ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f;
ar->v2d.tot.xmax= (float)((sa->winx > 120)? (sa->winx) : 120);
ar->v2d.tot.ymax= 0.0f;
@@ -6246,7 +6249,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
ar->v2d.min[1]= 0.0f;
ar->v2d.max[0]= MAXFRAMEF;
ar->v2d.max[1]= 10000.0f;
ar->v2d.max[1]= FLT_MAX;
ar->v2d.minzoom= 0.01f;
ar->v2d.maxzoom= 50;
@@ -10568,8 +10571,34 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
/* put 2.50 compatibility code here until next subversion bump */
if (1) {
{
/* fix for bad View2D extents for Animation Editors */
bScreen *screen;
ScrArea *sa;
SpaceLink *sl;
for (screen= main->screen.first; screen; screen= screen->id.next) {
for (sa= screen->areabase.first; sa; sa= sa->next) {
for (sl= sa->spacedata.first; sl; sl= sl->next) {
ListBase *regionbase;
ARegion *ar;
if (sl == sa->spacedata.first)
regionbase = &sa->regionbase;
else
regionbase = &sl->regionbase;
if (ELEM(sl->spacetype, SPACE_ACTION, SPACE_NLA)) {
for (ar = (ARegion*)regionbase->first; ar; ar = ar->next) {
if (ar->regiontype == RGN_TYPE_WINDOW) {
ar->v2d.cur.ymax= ar->v2d.tot.ymax= 0.0f;
ar->v2d.cur.ymin= ar->v2d.tot.ymin= (float)(-sa->winy) / 3.0f;
}
}
}
}
}
}
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */

View File

@@ -103,7 +103,7 @@ static SpaceLink *action_new(const bContext *C)
ar->regiontype= RGN_TYPE_WINDOW;
ar->v2d.tot.xmin= -10.0f;
ar->v2d.tot.ymin= (float)(-sa->winy);
ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f;
ar->v2d.tot.xmax= (float)(sa->winx);
ar->v2d.tot.ymax= 0.0f;
@@ -113,7 +113,7 @@ static SpaceLink *action_new(const bContext *C)
ar->v2d.min[1]= 0.0f;
ar->v2d.max[0]= MAXFRAMEF;
ar->v2d.max[1]= 10000.0f;
ar->v2d.max[1]= FLT_MAX;
ar->v2d.minzoom= 0.01f;
ar->v2d.maxzoom= 50;

View File

@@ -106,6 +106,7 @@ ARegion *nla_has_buttons_region(ScrArea *sa)
static SpaceLink *nla_new(const bContext *C)
{
Scene *scene= CTX_data_scene(C);
ScrArea *sa= CTX_wm_area(C);
ARegion *ar;
SpaceNla *snla;
@@ -151,7 +152,7 @@ static SpaceLink *nla_new(const bContext *C)
ar->regiontype= RGN_TYPE_WINDOW;
ar->v2d.tot.xmin= (float)(SFRA-10);
ar->v2d.tot.ymin= -500.0f;
ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f;
ar->v2d.tot.xmax= (float)(EFRA+10);
ar->v2d.tot.ymax= 0.0f;