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:
Diffstat (limited to 'source/blender/blenkernel/intern/paint.c')
-rw-r--r--source/blender/blenkernel/intern/paint.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 6a3062f10ae..df2f0c84f00 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -316,7 +316,8 @@ void BKE_paint_curve_set(Brush *br, PaintCurve *pc)
void BKE_palette_color_remove(Palette *palette, PaletteColor *color)
{
if (color) {
- if ((color == palette->colors.last) && (palette->colors.last != palette->colors.first))
+ int numcolors = BLI_countlist(&palette->colors);
+ if ((numcolors == palette->active_color + 1) && (numcolors != 1))
palette->active_color--;
BLI_remlink(&palette->colors, color);