From 95afc53604de148c0ed7cfbee88906ae09f6b807 Mon Sep 17 00:00:00 2001 From: Vincent Blankfield Date: Fri, 18 Dec 2020 14:04:58 +0100 Subject: 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 --- source/blender/editors/animation/anim_channels_defines.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index c70a86eab1d..6cb829d3a23 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -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); -- cgit v1.2.3