Fix T83716: Dope Sheet, incorrect scaling of channel UI elements

Change the top coordinate of the animation channel list UI elements to
`rect->ymin` so they correctly span from `rect->ymin` to
`channel_height`.

Some buttons in the dope sheet channels didn't scale properly with the
`Keyframe Scale Factor` preferences setting. This was caused by using
the `ymid` value (`ymid = BLI_rctf_cent_y(rect) - 0.5f * ICON_WIDTH`) to
position the buttons that supposed to fill all vertical space in the
channel (with `channel_height` height). The `ymid` value is only
appropriate for the UI elements that with `ICON_WIDTH` height.

Maniphest Tasks: T83716

Reviewed by: sybren

Differential Revision: https://developer.blender.org/D9841
This commit is contained in:
Vincent Blankfield 2020-12-18 14:04:58 +01:00 committed by Sybren A. Stüvel
parent e5764013b0
commit 95afc53604
Notes: blender-bot 2023-02-14 01:21:16 +01:00
Referenced by issue #83716, Dope Sheet UI Break Scaling Keys
1 changed files with 5 additions and 5 deletions

View File

@ -5353,7 +5353,7 @@ void ANIM_channel_draw_widgets(const bContext *C,
"",
ICON_NONE,
offset,
ymid,
rect->ymin,
SLIDER_WIDTH,
channel_height);
UI_but_func_set(but, achannel_setting_slider_nla_curve_cb, ale->id, ale->data);
@ -5411,7 +5411,7 @@ void ANIM_channel_draw_widgets(const bContext *C,
"",
icon,
offset,
ymid,
rect->ymin,
ICON_WIDTH,
channel_height);
}
@ -5437,7 +5437,7 @@ void ANIM_channel_draw_widgets(const bContext *C,
"",
icon,
offset,
ymid,
rect->ymin,
ICON_WIDTH,
channel_height);
}
@ -5457,7 +5457,7 @@ void ANIM_channel_draw_widgets(const bContext *C,
"",
ICON_NONE,
offset,
ymid,
rect->ymin,
width,
channel_height);
}
@ -5483,7 +5483,7 @@ void ANIM_channel_draw_widgets(const bContext *C,
"",
ICON_NONE,
offset,
ymid,
rect->ymin,
SLIDER_WIDTH,
channel_height);