Commit 692d4d26 authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Fix order-error.

Ref 2337
parent 9acd7f15
......@@ -239,12 +239,7 @@ KoColor KisVisualColorSelectorShape::convertShapeCoordinateToKoColor(QPointF coo
if (m_d->channel2==0) {
huedivider2 = 360.0;
}
if (m_d->model == ColorModel::Channel) {
channelValues[m_d->channel1] = coordinates.x();
if (m_d->dimension == Dimensions::twodimensional) {
channelValues[m_d->channel2] = coordinates.y();
}
} else {
if (m_d->model != ColorModel::Channel && c.colorSpace()->colorModelId().id() == "RGBA") {
if (c.colorSpace()->colorModelId().id() == "RGBA") {
QVector <float> inbetween(3);
if (m_d->model == ColorModel::HSV){
......@@ -263,6 +258,11 @@ KoColor KisVisualColorSelectorShape::convertShapeCoordinateToKoColor(QPointF coo
HSLToRGB(inbetween[0], inbetween[1], inbetween[2],&channelValues[0],&channelValues[1], &channelValues[2]);
}
}
} else {
channelValues[m_d->channel1] = coordinates.x();
if (m_d->dimension == Dimensions::twodimensional) {
channelValues[m_d->channel2] = coordinates.y();
}
}
c.colorSpace()->fromNormalisedChannelsValue(c.data(), channelValues);
return c;
......@@ -285,12 +285,7 @@ QPointF KisVisualColorSelectorShape::convertKoColorToShapeCoordinate(KoColor c)
if (m_d->channel2==0) {
huedivider2 = 360.0;
}
if (m_d->model == ColorModel::Channel) {
coordinates.setX(channelValues[m_d->channel1]);
if (m_d->dimension == Dimensions::twodimensional) {
coordinates.setY(channelValues[m_d->channel2]);
}
} else {
if (m_d->model != ColorModel::Channel && c.colorSpace()->colorModelId().id() == "RGBA") {
if (c.colorSpace()->colorModelId().id() == "RGBA") {
QVector <float> inbetween(3);
if (m_d->model == ColorModel::HSV){
......@@ -307,6 +302,11 @@ QPointF KisVisualColorSelectorShape::convertKoColorToShapeCoordinate(KoColor c)
}
}
}
} else {
coordinates.setX(channelValues[m_d->channel1]);
if (m_d->dimension == Dimensions::twodimensional) {
coordinates.setY(channelValues[m_d->channel2]);
}
}
return coordinates;
}
......
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