Fix #113365: Backdrop lines don't match height in nla

Adjust ymax of action in frame range so that height will match with the
channel's height. Use same ymax as in `acf_nlaaction_backdrop`.
Also fixed `ycenter` value.

Pull Request: https://projects.blender.org/blender/blender/pulls/113490
This commit is contained in:
Pratik Borhade
2024-02-07 08:12:13 +01:00
committed by Pratik Borhade
parent c743213c3b
commit af27c1feed

View File

@@ -806,7 +806,7 @@ void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *region)
ale = ale->next, ymax -= NLATRACK_STEP(snla))
{
float ymin = ymax - NLATRACK_HEIGHT(snla);
float ycenter = (ymax + ymin) / 2.0f;
float ycenter = (ymax + ymin + 2 * NLATRACK_SKIP - 1) / 2.0f;
/* check if visible */
if (IN_RANGE(ymin, v2d->cur.ymin, v2d->cur.ymax) ||
@@ -869,8 +869,11 @@ void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *region)
*/
switch (adt->act_extendmode) {
case NLASTRIP_EXTEND_HOLD: {
immRectf(
pos, v2d->cur.xmin, ymin + NLATRACK_SKIP, v2d->cur.xmax, ymax - NLATRACK_SKIP);
immRectf(pos,
v2d->cur.xmin,
ymin + NLATRACK_SKIP,
v2d->cur.xmax,
ymax + NLATRACK_SKIP - 1);
break;
}
case NLASTRIP_EXTEND_HOLD_FORWARD: {
@@ -894,7 +897,7 @@ void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *region)
static_cast<bAction *>(ale->data),
ycenter,
ymin + NLATRACK_SKIP,
ymax - NLATRACK_SKIP);
ymax + NLATRACK_SKIP - 1);
GPU_blend(GPU_BLEND_NONE);
break;