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

List:       kde-commits
Subject:    koffice/krita/core
From:       Adrian Page <adrian () pagenet ! plus ! com>
Date:       2006-01-31 23:25:52
Message-ID: 1138749952.191620.13836.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 504408 by page:

Stop unselected transparent areas appearing the same as selected transparent areas.


 M  +14 -3     kis_selection.cc  


--- trunk/koffice/krita/core/kis_selection.cc #504407:504408
@@ -184,13 +184,14 @@
                 // this is where we come if the pixels should be blue or bluish
 
                 Q_UINT8 g = (*(j + 0)  + *(j + 1 ) + *(j + 2 )) / 9;
+                Q_UINT8 alpha = *(j + 3);
 
+                // Colour influence is proportional to alpha.
+                g = UINT8_MULT(g, alpha);
+
                 if(s==MIN_SELECTED)
                 {
                     //this is where we come if the pixels should be blue (or red outline)
-                    *(j+0) = 165+g ;
-                    *(j+1) = 128+g;
-                    *(j+2) = 128+g;
 
                     // now for a simple outline based on 4-connectivity
                     if(preS != MIN_SELECTED
@@ -202,6 +203,16 @@
                         *(j+1) = 0;
                         *(j+2) = 255;
                     }
+                    else
+                    {
+                        *(j+0) = 165+g;
+                        *(j+1) = 128+g;
+                        *(j+2) = 128+g;
+                    }
+
+                    // Stop unselected transparent areas from appearing the same
+                    // as selected transparent areas.
+                    *(j+3) = QMAX(alpha, 192);
                 }
                 else
                 {
[prev in list] [next in list] [prev in thread] [next in thread] 

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