Commit 6b2f1c43 authored by Jasper Hartog's avatar Jasper Hartog

Value of channel now carries over when switching channels

The value from the Integer channel now caries over to the Float channel
in the Specific Color Selector, which broke in a previous commit.
parent 88667a38
......@@ -292,6 +292,24 @@ QWidget* KisFloatColorInput::createInput()
m_dblNumInput->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
m_dblNumInput->setMinimumWidth(60);
m_dblNumInput->setMaximumWidth(60);
quint8* data = m_color->data() + m_channelInfo->pos();
qreal value = 1.0;
switch (m_channelInfo->channelValueType()) {
#ifdef HAVE_OPENEXR
case KoChannelInfo::FLOAT16:
value = *(reinterpret_cast<half*>(data));
break;
#endif
case KoChannelInfo::FLOAT32:
value = *(reinterpret_cast<float*>(data));
break;
default:
Q_ASSERT(false);
}
m_dblNumInput->setValue(value);
return m_dblNumInput;
}
......
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