Fixed: now you cannot select invalid colors with the color-bar.

This commit is contained in:
David Capello 2010-06-01 22:42:20 -03:00
parent 2a2effa4ff
commit a17a3de4d4

View File

@ -427,11 +427,15 @@ bool ColorBar::msg_proc(JMessage msg)
default:
color_t color = getHotColor(m_hot);
if (msg->mouse.left) {
this->setFgColor(color);
}
if (msg->mouse.right) {
this->setBgColor(color);
// Check if the color is invalid (e.g. index out of range)
if (color_is_valid(color)) {
if (msg->mouse.left) {
this->setFgColor(color);
}
if (msg->mouse.right) {
this->setBgColor(color);
}
}
break;
}