Enable Remap button only for Indexed images

This commit is contained in:
David Capello 2015-05-21 10:44:15 -03:00
parent 5fc3b06e8e
commit 9b07e0f9bf

View File

@ -404,6 +404,9 @@ void ColorBar::onPaletteViewRemapColors(const Remap& remap, const Palette* newPa
void ColorBar::applyRemap(const doc::Remap& remap, const doc::Palette* newPalette, const std::string& actionText)
{
doc::Site site = UIContext::instance()->activeSite();
if (site.sprite() &&
site.sprite()->pixelFormat() == IMAGE_INDEXED) {
if (!m_remap) {
m_remap.reset(new doc::Remap(remap));
m_remapButton.setVisible(true);
@ -412,6 +415,7 @@ void ColorBar::applyRemap(const doc::Remap& remap, const doc::Palette* newPalett
else {
m_remap->merge(remap);
}
}
setPalette(newPalette, actionText);
}