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:
authorAntony Riakiotakis <kalast@gmail.com>2014-09-18 15:03:02 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-09-18 15:03:02 +0400
commit070ce416b9b4714d1805eb920384d447648ed71e (patch)
treefaa9f8b0a7c872c951a2e1c9eafbdc38be7b36bc /source/blender/blenkernel/intern/paint.c
parent90c1afb02005671bb631c0fcb8b4981c3aa6e89e (diff)
One last tweak to palette deletion code. It would correct active color
only when deleting the last color.
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);