diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-09-18 15:03:02 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-09-18 15:03:02 +0400 |
commit | 070ce416b9b4714d1805eb920384d447648ed71e (patch) | |
tree | faa9f8b0a7c872c951a2e1c9eafbdc38be7b36bc | |
parent | 90c1afb02005671bb631c0fcb8b4981c3aa6e89e (diff) |
One last tweak to palette deletion code. It would correct active color
only when deleting the last color.
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 3 |
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); |