Commit 16678ad7 authored by Carl Olsson's avatar Carl Olsson

* Limit alpha index max to current palette size

* Remove stray comment
parent dab6f4b0
......@@ -112,8 +112,12 @@ KisPalettizeWidget::KisPalettizeWidget(QWidget* parent)
QObject::connect(alphaClipSpinBox, &KisDoubleSliderSpinBox::valueChanged, this, &KisConfigWidget::sigConfigurationItemChanged);
alphaIndexSpinBox->setPrefix(QString("%1 ").arg(i18n("Index:")));
alphaIndexSpinBox->setRange(0, 255); // Limit to 4 colours is arbitrary, but larger values give universally poor results
alphaIndexSpinBox->setRange(0, 255);
QObject::connect(alphaIndexSpinBox, &KisSliderSpinBox::valueChanged, this, &KisConfigWidget::sigConfigurationItemChanged);
QObject::connect(m_paletteWidget, &KoResourceItemChooser::resourceSelected, [this](){
const KoColorSet* const palette = static_cast<const KoColorSet*>(m_paletteWidget->currentResource());
alphaIndexSpinBox->setMaximum(palette ? int(palette->colorCount() - 1) : 0);
});
}
void KisPalettizeWidget::setConfiguration(const KisPropertiesConfigurationSP config)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment