The color gradients displayed on the sliders in the color editor were being calculate...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 25 Sep 2007 12:29:02 +0000 (12:29 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 25 Sep 2007 12:29:02 +0000 (12:29 +0000)
git-svn-id: http://svn.voria.com/code@753 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/widget_coloredit.cpp

index 37d4523..fc87e3c 100644 (file)
@@ -157,38 +157,18 @@ ColorSlider::redraw(GdkEventExpose */*bleh*/)
        int i;
        for(i=width-1;i>=0;i--)
        {
-               color_func(color,float(i)/float(width));
+               color_func(color,gamma_out(float(i)/float(width)));
                const Color c1(Color::blend(color,bg1,1.0).clamped());
                const Color c2(Color::blend(color,bg2,1.0).clamped());
                assert(c1.is_valid());
                assert(c2.is_valid());
 
-               gushort r1;
-               gushort g1;
-               gushort b1;
-               gushort r2;
-               gushort g2;
-               gushort b2;
-
-               if(use_colorspace_gamma() && (type<TYPE_U))
-               {
-                       r1=(256*App::gamma.r_F32_to_U8(gamma_out(c1.get_r())));
-                       g1=(256*App::gamma.g_F32_to_U8(gamma_out(c1.get_g())));
-                       b1=(256*App::gamma.b_F32_to_U8(gamma_out(c1.get_b())));
-                       r2=(256*App::gamma.r_F32_to_U8(gamma_out(c2.get_r())));
-                       g2=(256*App::gamma.g_F32_to_U8(gamma_out(c2.get_g())));
-                       b2=(256*App::gamma.b_F32_to_U8(gamma_out(c2.get_b())));
-               }
-               else
-               {
-                       r1=(256*App::gamma.r_F32_to_U8(c1.get_r()));
-                       g1=(256*App::gamma.g_F32_to_U8(c1.get_g()));
-                       b1=(256*App::gamma.b_F32_to_U8(c1.get_b()));
-                       r2=(256*App::gamma.r_F32_to_U8(c2.get_r()));
-                       g2=(256*App::gamma.g_F32_to_U8(c2.get_g()));
-                       b2=(256*App::gamma.b_F32_to_U8(c2.get_b()));
-               }
-
+               gushort r1=256*App::gamma.r_F32_to_U8(c1.get_r());
+               gushort g1=256*App::gamma.g_F32_to_U8(c1.get_g());
+               gushort b1=256*App::gamma.b_F32_to_U8(c1.get_b());
+               gushort r2=256*App::gamma.r_F32_to_U8(c2.get_r());
+               gushort g2=256*App::gamma.g_F32_to_U8(c2.get_g());
+               gushort b2=256*App::gamma.b_F32_to_U8(c2.get_b());
 
                if((i*2/height)&1)
                {