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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 4382d74f34e..296ca09a901 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -315,8 +315,14 @@ void BKE_paint_curve_set(Brush *br, PaintCurve *pc)
/* remove colour from palette. Must be certain color is inside the palette! */
void BKE_palette_color_remove(Palette *palette, PaletteColor *color)
{
+ int num_items;
BLI_remlink(&palette->colors, color);
+
+ num_items = BLI_countlist(&palette->colors);
+
BLI_addhead(&palette->deleted, color);
+ if (palette->active_color == num_items && num_items > 0)
+ palette->active_color--;
}
void BKE_palette_cleanup(Palette *palette)