From a35828d3eb9c2f54d79f13106b687f9efcc561d3 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 2 Jul 2015 10:33:51 -0300 Subject: [PATCH] Fix ChangeColorCommand to select colors only inside palette range (fix #714) --- src/app/commands/cmd_change_color.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/commands/cmd_change_color.cpp b/src/app/commands/cmd_change_color.cpp index 571bf3426..af172eff7 100644 --- a/src/app/commands/cmd_change_color.cpp +++ b/src/app/commands/cmd_change_color.cpp @@ -14,7 +14,9 @@ #include "app/app.h" #include "app/commands/command.h" #include "app/commands/params.h" +#include "app/modules/palettes.h" #include "app/ui/color_bar.h" +#include "doc/palette.h" namespace app { @@ -75,7 +77,7 @@ void ChangeColorCommand::onExecute(Context* context) case IncrementIndex: if (color.getType() == app::Color::IndexType) { int index = color.getIndex(); - if (index < 255) // TODO use sprite palette limit + if (index < get_current_palette()->size()-1) color = app::Color::fromIndex(index+1); } else