From 0fbc3e956f36eabca770903d6f548a87d7a44571 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Fri, 1 Dec 2023 20:01:22 +0100 Subject: [PATCH] Fix #115601: Clamp Color Picker Vertical Value Slider Position The position of the vertical value slider has to be clamped to be within the area of that slider, otherwise it can draw outside the range when a value is over 1. Pull Request: https://projects.blender.org/blender/blender/pulls/115680 --- source/blender/editors/interface/interface_widgets.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/interface/interface_widgets.cc b/source/blender/editors/interface/interface_widgets.cc index c4c3f70a5c9..77d579ec8cb 100644 --- a/source/blender/editors/interface/interface_widgets.cc +++ b/source/blender/editors/interface/interface_widgets.cc @@ -3294,7 +3294,8 @@ static void ui_draw_but_HSV_v(uiBut *but, const rcti *rect) UI_draw_roundbox_4fv_ex(&rectf, inner1, inner2, U.pixelsize, outline, 1.0f, 0.0f); /* cursor */ - const float y = rect->ymin + v * BLI_rcti_size_y(rect); + float y = rect->ymin + v * BLI_rcti_size_y(rect); + CLAMP(y, float(rect->ymin) + (2.0f * UI_SCALE_FAC), float(rect->ymax) - (2.0f * UI_SCALE_FAC)); rectf.ymin = y - (4.0f * UI_SCALE_FAC) - U.pixelsize; rectf.ymax = y + (4.0f * UI_SCALE_FAC) + U.pixelsize; float col[4] = {0.0f, 0.0f, 0.0f, 1.0f};