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:
authorDalai Felinto <dfelinto@gmail.com>2017-06-27 17:53:43 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-06-27 17:56:43 +0300
commitf11bcbed9d0402db271bc610eaec156583e746fa (patch)
tree537a58fabcdbc9b773c208b0c9692f433bf28680 /source/blender/editors/space_buttons
parentbb0e8f1c552adfb67f34551f061f2b901e1f2d90 (diff)
Fix T51913: Context tab for textures issue
The original code was doing a sanity check to see if existing index was out of range. However the comparison was wrong. So if the previous ct->user (active index of texture node) was larger than then number of available texture nodes + 1 in the other material, we would never re-set the index to 0. Bug introduced on c31f74de6bb7. There was an early attempt of fixing this (2b2ac5d3cc) but it was just working by pure, luck. And failing in cases like the one from this bug report.
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r--source/blender/editors/space_buttons/buttons_texture.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c
index 72de7e5c81c..1d67ac620b0 100644
--- a/source/blender/editors/space_buttons/buttons_texture.c
+++ b/source/blender/editors/space_buttons/buttons_texture.c
@@ -470,7 +470,7 @@ void buttons_texture_context_compute(const bContext *C, SpaceButs *sbuts)
}
else {
/* set one user as active based on active index */
- if (ct->index == BLI_listbase_count_ex(&ct->users, ct->index + 1))
+ if (ct->index >= BLI_listbase_count_ex(&ct->users, ct->index + 1))
ct->index = 0;
ct->user = BLI_findlink(&ct->users, ct->index);