Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-09-04 20:26:12 +0300
committerJulian Eisel <julian@blender.org>2020-09-04 22:26:30 +0300
commit47881791be0538f9558b2ef091e1761187df250d (patch)
tree11590c150195ee160e255722bb7ffe00825b9ca4 /source/blender/editors/interface/interface_draw.c
parent120f4507f640cf8b356476a9e82e6301981cfcfd (diff)
UI Code Quality: Store curve-button gradient type in derived struct
We want to move away from using `uiBut.a1`/`a2`, which is a hard to reason about design. Part of T74432. Also correct comment.
Diffstat (limited to 'source/blender/editors/interface/interface_draw.c')
-rw-r--r--source/blender/editors/interface/interface_draw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 13dd4ce3001..4d53018cd32 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -1922,7 +1922,7 @@ void ui_draw_but_CURVE(ARegion *region, uiBut *but, const uiWidgetColors *wcol,
BLI_rcti_size_y(&scissor_new));
/* Do this first to not mess imm context */
- if (but->a1 == UI_GRAD_H) {
+ if (but_cumap->gradient_type == UI_GRAD_H) {
/* magic trigger for curve backgrounds */
const float col[3] = {0.0f, 0.0f, 0.0f}; /* dummy arg */
@@ -1945,7 +1945,7 @@ void ui_draw_but_CURVE(ARegion *region, uiBut *but, const uiWidgetColors *wcol,
/* backdrop */
float color_backdrop[4] = {0, 0, 0, 1};
- if (but->a1 == UI_GRAD_H) {
+ if (but_cumap->gradient_type == UI_GRAD_H) {
/* grid, hsv uses different grid */
GPU_blend(GPU_BLEND_ALPHA);
ARRAY_SET_ITEMS(color_backdrop, 0, 0, 0, 48.0 / 255.0);
@@ -2002,7 +2002,7 @@ void ui_draw_but_CURVE(ARegion *region, uiBut *but, const uiWidgetColors *wcol,
if (cumap->flag & CUMA_DRAW_SAMPLE) {
immBegin(GPU_PRIM_LINES, 2); /* will draw one of the following 3 lines */
- if (but->a1 == UI_GRAD_H) {
+ if (but_cumap->gradient_type == UI_GRAD_H) {
float tsample[3];
float hsv[3];
linearrgb_to_srgb_v3_v3(tsample, cumap->sample);