diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-06-04 15:50:43 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-06-04 15:52:31 +0300 |
commit | 7484ed9bdcba1460b0fa1785dd207a5a0e872cae (patch) | |
tree | 073a6c76723f3f6a201072671b189608a4809064 | |
parent | 33e8db94b1e7df2bd7fdbf15b96368c8d16d3b4e (diff) |
NLA Editor: box-select was selecting wrong elements
This was missing in rBfa59346c134.
-rw-r--r-- | source/blender/editors/space_nla/nla_select.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 0de9acfec25..eecb17cc185 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -233,7 +233,6 @@ static void box_select_nla_strips(bAnimContext *ac, rcti rect, short mode, short SpaceNla *snla = (SpaceNla *)ac->sl; View2D *v2d = &ac->ar->v2d; rctf rectf; - float ymin /* =(float)(-NLACHANNEL_HEIGHT(snla)) */ /* UNUSED */, ymax = 0; /* convert border-region to view coordinates */ UI_view2d_region_to_view(v2d, rect.xmin, rect.ymin + 2, &rectf.xmin, &rectf.ymin); @@ -247,8 +246,9 @@ static void box_select_nla_strips(bAnimContext *ac, rcti rect, short mode, short selectmode = selmodes_to_flagmodes(selectmode); /* loop over data, doing box select */ - for (ale = anim_data.first; ale; ale = ale->next) { - ymin = ymax - NLACHANNEL_STEP(snla); + float ymax = NLACHANNEL_FIRST_TOP(ac); + for (ale = anim_data.first; ale; ale = ale->next, ymax -= NLACHANNEL_STEP(snla)) { + float ymin = ymax - NLACHANNEL_HEIGHT(snla); /* perform vertical suitability check (if applicable) */ if ((mode == NLA_BOXSEL_FRAMERANGE) || !((ymax < rectf.ymin) || (ymin > rectf.ymax))) { @@ -270,9 +270,6 @@ static void box_select_nla_strips(bAnimContext *ac, rcti rect, short mode, short } } } - - /* set minimum extent to be the maximum of the next channel */ - ymax = ymin; } /* cleanup */ |