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:
authorCampbell Barton <ideasman42@gmail.com>2014-08-29 10:56:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-08-29 10:56:19 +0400
commit1d9e69f1463f01ab2242b05cb6a0486a6f9eaeaf (patch)
treef9ca95c68436ac36ceda4f9ece0b345366d5bfc2 /source/blender/editors/interface/interface_handlers.c
parent55cacb2e63e342705e25e205c1b805956a7226bd (diff)
Fix T41617: Color ramp crashes user preferences
Color ramps with no handles caused issues.
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r--source/blender/editors/interface/interface_handlers.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 166090c95ca..2d919a2afc1 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -5020,6 +5020,9 @@ static bool ui_numedit_but_COLORBAND(uiBut *but, uiHandleButtonData *data, int m
if (data->draglastx == mx)
return changed;
+ if (data->coba->tot == 0)
+ return changed;
+
dx = ((float)(mx - data->draglastx)) / BLI_rctf_size_x(&but->rect);
data->dragcbd->pos += dx;
CLAMP(data->dragcbd->pos, 0.0f, 1.0f);