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

List:       kde-commits
Subject:    [krita/krita-testing-wolthera] libs/ui/widgets: Make color selector faster.
From:       Wolthera van Hovell tot Westerflier <griffinvalley () gmail ! com>
Date:       2016-08-23 14:22:27
Message-ID: E1bcCax-0002U9-Pn () code ! kde ! org
[Download RAW message or body]

Git commit 960bde483a5f66918bfb5507b7e15559d5d9cb6e by Wolthera van Hovell tot \
Westerflier. Committed on 23/08/2016 at 11:56.
Pushed by woltherav into branch 'krita-testing-wolthera'.

Make color selector faster.

By removing a mask check.

Ref T2438

M  +24   -25   libs/ui/widgets/kis_visual_color_selector.cpp

http://commits.kde.org/krita/960bde483a5f66918bfb5507b7e15559d5d9cb6e

diff --git a/libs/ui/widgets/kis_visual_color_selector.cpp \
b/libs/ui/widgets/kis_visual_color_selector.cpp index b9ad0db..93b06d4 100644
--- a/libs/ui/widgets/kis_visual_color_selector.cpp
+++ b/libs/ui/widgets/kis_visual_color_selector.cpp
@@ -965,34 +965,33 @@ QPointF \
KisVisualEllipticalSelectorShape::convertWidgetCoordinateToShapeCoordina  //default \
implementation:  qreal x = 0.5;
     qreal y = 1.0;
-    if (mask().contains(coordinate)) {
-        QRect total(0, 0, width(), height());
-        QLineF line(total.center(), coordinate);
-        qreal a = total.width()/2;
-        qreal angle;
-
-        if (m_type!=KisVisualEllipticalSelectorShape::borderMirrored){
-            angle = fmod((line.angle()+180.0), 360.0);
-            angle = 180.0-angle;
-            angle = angle+180.0;
-            x = angle/360.0;
-            if (getDimensions()==KisVisualColorSelectorShape::twodimensional) {
-                y = qBound(0.0,line.length()/a, 1.0);
-            }
-
-        } else {
-            angle = fmod((line.angle()+270.0), 360.0);
-            if (angle>180.0) {
-                angle = 180.0-angle;
-                angle = angle+180;
-            }
-            x = (angle/360.0)*2;
-            if (getDimensions()==KisVisualColorSelectorShape::twodimensional) {
-                y = line.length()/a;
-            }
+    QRect total(0, 0, width(), height());
+    QLineF line(total.center(), coordinate);
+    qreal a = total.width()/2;
+    qreal angle;
+
+    if (m_type!=KisVisualEllipticalSelectorShape::borderMirrored){
+        angle = fmod((line.angle()+180.0), 360.0);
+        angle = 180.0-angle;
+        angle = angle+180.0;
+        x = angle/360.0;
+        if (getDimensions()==KisVisualColorSelectorShape::twodimensional) {
+            y = qBound(0.0,line.length()/a, 1.0);
         }
 
+    } else {
+        angle = fmod((line.angle()+270.0), 360.0);
+        if (angle>180.0) {
+            angle = 180.0-angle;
+            angle = angle+180;
+        }
+        x = (angle/360.0)*2;
+        if (getDimensions()==KisVisualColorSelectorShape::twodimensional) {
+            y = line.length()/a;
+        }
     }
+
+
     return QPointF(x, y);
 }
 


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

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