[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [krita/krita-testing-wolthera] libs/ui/widgets: Fix order-error.
From:       Wolthera van Hovell tot Westerflier <griffinvalley () gmail ! com>
Date:       2016-08-14 17:29:00
Message-ID: E1bYzDY-0007yt-2y () code ! kde ! org
[Download RAW message or body]

Git commit 692d4d261de781aaf6901b984639eeedcc1ad967 by Wolthera van Hovell tot \
Westerflier. Committed on 14/08/2016 at 17:28.
Pushed by woltherav into branch 'krita-testing-wolthera'.

Fix order-error.

Ref 2337

M  +12   -12   libs/ui/widgets/kis_visual_color_selector.cpp

http://commits.kde.org/krita/692d4d261de781aaf6901b984639eeedcc1ad967

diff --git a/libs/ui/widgets/kis_visual_color_selector.cpp \
b/libs/ui/widgets/kis_visual_color_selector.cpp index 1667e2f..d8e2c8f 100644
--- a/libs/ui/widgets/kis_visual_color_selector.cpp
+++ b/libs/ui/widgets/kis_visual_color_selector.cpp
@@ -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;
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic