From 82b17039edcd3563b80b5448baf16f97f9f2e9e5 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 6 Jul 2011 01:34:10 +0000 Subject: NLA Drawing - When "Show Control Curves" option in View menu is disabled, the strips are drawn so that they take up less vertical space. Originally, the primary reason why these were taller than those in the other animation editors was really so that these control curves could be visualised adequately. So, when these aren't shown, we can afford to collapse the strips vertically. This should make it possible to fit more strips on screen to retime them. in some staggered fashion. --- source/blender/editors/space_nla/nla_select.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_nla/nla_select.c') diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 5efa3f34c98..5dc937d3ce1 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -225,9 +225,10 @@ static void borderselect_nla_strips (bAnimContext *ac, rcti rect, short mode, sh bAnimListElem *ale; int filter; + SpaceNla *snla = (SpaceNla *)ac->sl; View2D *v2d= &ac->ar->v2d; rctf rectf; - float ymin=(float)(-NLACHANNEL_HEIGHT), ymax=0; + float ymin=(float)(-NLACHANNEL_HEIGHT(snla)), ymax=0; /* convert border-region to view coordinates */ UI_view2d_region_to_view(v2d, rect.xmin, rect.ymin+2, &rectf.xmin, &rectf.ymin); @@ -242,7 +243,7 @@ static void borderselect_nla_strips (bAnimContext *ac, rcti rect, short mode, sh /* loop over data, doing border select */ for (ale= anim_data.first; ale; ale= ale->next) { - ymin= ymax - NLACHANNEL_STEP; + ymin= ymax - NLACHANNEL_STEP(snla); /* perform vertical suitability check (if applicable) */ if ( (mode == NLA_BORDERSEL_FRAMERANGE) || @@ -505,6 +506,7 @@ static void mouse_nla_strips (bContext *C, bAnimContext *ac, const int mval[2], bAnimListElem *ale = NULL; int filter; + SpaceNla *snla = (SpaceNla *)ac->sl; View2D *v2d= &ac->ar->v2d; Scene *scene= ac->scene; NlaStrip *strip = NULL; @@ -515,7 +517,7 @@ static void mouse_nla_strips (bContext *C, bAnimContext *ac, const int mval[2], /* use View2D to determine the index of the channel (i.e a row in the list) where keyframe was */ UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y); - UI_view2d_listview_view_to_cell(v2d, 0, NLACHANNEL_STEP, 0, (float)NLACHANNEL_HEIGHT_HALF, x, y, NULL, &channel_index); + UI_view2d_listview_view_to_cell(v2d, 0, NLACHANNEL_STEP(snla), 0, (float)NLACHANNEL_HEIGHT_HALF(snla), x, y, NULL, &channel_index); /* x-range to check is +/- 7 (in screen/region-space) on either side of mouse click * (that is the size of keyframe icons, so user should be expecting similar tolerances) -- cgit v1.2.3